Doubao Seedream
Doubao Seedream image generation supports text-to-image, single-image reference, multi-image reference, and sequential image generation. The platform uses the async task protocol: create a task to receive a taskId, then query the task or use a callback to retrieve results.
Model
| Model Name | Output | Mode |
|---|---|---|
doubao-seedream-5.0-lite | Image URLs | Text-to-image, image references, sequential generation, web search |
doubao-seedream-4.5 | Image URLs | Text-to-image, image references, sequential generation |
Pricing
Priced by successfully generated images. Failed images are not charged.
| Model | Credits |
|---|---|
doubao-seedream-5.0-lite | 15 credits/image |
doubao-seedream-4.5 | 15 credits/image |
Sequential generation pre-charges the maximum possible image count. After completion, unused image credits are refunded based on the number of successful images.
Create Task
curl -X POST https://api.aivideoapi.ai/v1/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5.0-lite",
"callback_url": "https://your-server.com/webhook",
"input": {
"prompt": "An orange cat reading beside a window, watercolor illustration, soft morning light",
"size": "2K",
"watermark": false
}
}'
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | doubao-seedream-5.0-lite or doubao-seedream-4.5 |
input | object | Yes | Generation parameters, see below |
callback_url | string | No | Optional callback URL for completion/failure notifications |
Input Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Image generation prompt. Chinese and English are supported. |
image_urls | string[] | No | Public HTTP(S) reference image URLs. Base64 input is not supported. 1-14 images when provided. |
size | string | No | Output size, defaults to 2048x2048. Use a resolution tier or pixel size; see Size & Resolution. |
sequential_image_generation | string | No | Sequential generation mode, defaults to disabled. One of: disabled, auto. |
sequential_image_generation_options | object | No | Sequential generation options. Only used when sequential_image_generation=auto. |
tools | array | No | Only supported by doubao-seedream-5.0-lite. Use [{ "type": "web_search" }]. |
stream | boolean | No | Whether to request upstream streaming, defaults to false. The platform still returns final images through the task result. |
output_format | string | No | Only supported by doubao-seedream-5.0-lite. One of: jpeg, png. Defaults to jpeg. |
watermark | boolean | No | Whether to add a watermark, defaults to true. |
optimize_prompt_options | object | No | Prompt optimization options. Currently supports { "mode": "standard" }. |
doubao-seedream-4.5 does not support 3K, tools, or output_format.
Reference Image Limits
| Limit | Requirement |
|---|---|
| Image formats | jpeg, png, webp, bmp, tiff, gif, heic, heif |
| File size | Up to 30 MB per image |
| Total pixels | Up to 6000×6000 per image |
| Width and height | Both must be greater than 14 px |
| Aspect ratio | [1/16, 16] |
| Multi-image reference | Up to 14 images |
When sequential generation is enabled, reference image count plus generated image count must not exceed 15.
Size & Resolution
size can be a resolution tier or a pixel size such as 2048x2048. Pixel sizes must have total pixels between 2560x1440 and 4096x4096, with aspect ratio between [1/16, 16].
| Model | Supported Tiers | Default |
|---|---|---|
doubao-seedream-5.0-lite | 2K, 3K, 4K | 2048x2048 |
doubao-seedream-4.5 | 2K, 4K | 2048x2048 |
Common sizes:
| Resolution | Aspect Ratio | Pixel Size |
|---|---|---|
2K | 1:1 | 2048x2048 |
2K | 4:3 | 2304x1728 |
2K | 3:4 | 1728x2304 |
2K | 16:9 | 2848x1600 |
2K | 9:16 | 1600x2848 |
2K | 3:2 | 2496x1664 |
2K | 2:3 | 1664x2496 |
2K | 21:9 | 3136x1344 |
3K | 1:1 | 3072x3072 |
3K | 4:3 | 3456x2592 |
3K | 3:4 | 2592x3456 |
3K | 16:9 | 4096x2304 |
3K | 9:16 | 2304x4096 |
3K | 3:2 | 3744x2496 |
3K | 2:3 | 2496x3744 |
3K | 21:9 | 4704x2016 |
4K | 1:1 | 4096x4096 |
4K | 4:3 | 4704x3520 |
4K | 3:4 | 3520x4704 |
4K | 16:9 | 5504x3040 |
4K | 9:16 | 3040x5504 |
4K | 3:2 | 4992x3328 |
4K | 2:3 | 3328x4992 |
4K | 21:9 | 6240x2656 |
3K is only supported by doubao-seedream-5.0-lite.
Sequential Generation
sequential_image_generation controls whether to generate an image set:
| Value | Description |
|---|---|
disabled | Disable sequential generation and generate one image. |
auto | Let the model decide whether to return an image set and how many images to generate. |
sequential_image_generation_options supports:
| Field | Type | Required | Description |
|---|---|---|---|
max_images | integer | No | Maximum generated images, 1-15. |
Example: Text-to-Image
curl -X POST https://api.aivideoapi.ai/v1/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5.0-lite",
"callback_url": "https://your-server.com/webhook",
"input": {
"prompt": "A cinematic night city poster with neon reflections on a rainy street",
"size": "2K",
"watermark": false
}
}'
Example: Multi-Image Reference
curl -X POST https://api.aivideoapi.ai/v1/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4.5",
"callback_url": "https://your-server.com/webhook",
"input": {
"prompt": "Use the subject and colors from the two references to create a clean premium product poster",
"image_urls": [
"https://example.com/reference-1.png",
"https://example.com/reference-2.png"
],
"size": "2048x2048"
}
}'
Example: Sequential Generation With Web Search
curl -X POST https://api.aivideoapi.ai/v1/images/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5.0-lite",
"callback_url": "https://your-server.com/webhook",
"input": {
"prompt": "Generate a set of ecommerce detail-page images for summer camping gear, including a tent, lantern, folding chair, and outdoor table",
"size": "3K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 6
},
"tools": [
{ "type": "web_search" }
],
"output_format": "png"
}
}'
Response
{
"code": 200,
"msg": "success",
"data": {
"taskId": "397ce9f2-c04e-4244-ac33-3af19a7cc297"
}
}
Query Task
curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
-H "Authorization: Bearer sk-your-api-key"
Status flow: pending -> processing -> completed or failed.
Completed
{
"id": "397ce9f2-c04e-4244-ac33-3af19a7cc297",
"status": "completed",
"model": "doubao-seedream-5.0-lite",
"created_at": 1775383908,
"completed_at": 1775383925,
"output": {
"urls": [
"https://file.aivideoapi.ai/images/2026/07/04/abc123.png"
],
"metadata": {
"model": "doubao-seedream-5.0-lite",
"generated_images": 1,
"requested_image_count": 1,
"output_format": "png",
"image_sizes": ["2048x2048"],
"partial_errors": [],
"usage": {
"generated_images": 1,
"output_tokens": 16384,
"total_tokens": 16384
}
}
}
}
Partial Sequential Failure
If at least one image succeeds, the task is marked completed. Successful images are returned normally and failed images are recorded in metadata.partial_errors. Billing is based only on successful images.
{
"id": "397ce9f2-c04e-4244-ac33-3af19a7cc297",
"status": "completed",
"model": "doubao-seedream-5.0-lite",
"output": {
"urls": [
"https://file.aivideoapi.ai/images/2026/07/04/abc123.png"
],
"metadata": {
"generated_images": 1,
"requested_image_count": 2,
"partial_errors": [
{
"index": 1,
"code": "image_generation_failed",
"message": "Some images failed to generate. Adjust parameters and retry."
}
]
}
}
}
Failed
{
"id": "57c8772c-f834-46f3-9b7d-81f92e104050",
"status": "failed",
"model": "doubao-seedream-5.0-lite",
"created_at": 1775383908,
"error": {
"code": "upstream_error",
"message": "Image generation failed"
}
}
Failed tasks are automatically refunded.
Callback Notifications
Pass callback_url when creating the task. When the task completes or fails, we send a POST request whose payload matches the GET /v1/tasks/{taskId} response.
Error Codes
When a request fails, the API returns a JSON error response:
{
"error": {
"code": "insufficient_credits",
"message": "Your credit balance is too low. Please top up.",
"type": "billing_error"
}
}
Error Reference
| HTTP Status | Code | Type | Description |
|---|---|---|---|
| 400 | invalid_request | invalid_request_error | Missing or invalid parameters |
| 401 | invalid_api_key | authentication_error | API key is invalid, disabled, or deleted |
| 402 | insufficient_credits | billing_error | Credit balance too low, please top up |
| 403 | ip_not_allowed | permission_error | Request IP not in the key's allowlist |
| 404 | model_not_found | invalid_request_error | Model does not exist or is inactive |
| 404 | task_not_found | invalid_request_error | Task ID does not exist |
| 429 | rate_limit_exceeded | rate_limit_error | Too many requests, please slow down |
| 429 | spend_limit_exceeded | billing_error | Key spend limit reached (hourly/daily/total) |
| 500 | internal_error | api_error | Unexpected server error |
| 503 | upstream_error | upstream_error | Upstream AI provider returned an error |
Common Scenarios
invalid_request (400)
Returned when required fields are missing or invalid.
{
"error": {
"code": "invalid_request",
"message": "'model' is required.",
"type": "invalid_request_error"
}
}
insufficient_credits (402)
Your balance is too low. Check your balance with GET /v1/credits and top up in Dashboard > Billing.
invalid_api_key (401)
Possible causes:
- The key does not start with
sk- - The key has been disabled or deleted
- The user account has been banned
upstream_error (503)
The upstream AI provider returned an error. This may happen when:
- The input contains sensitive or prohibited content
- The provider is temporarily unavailable
- The request parameters are not supported by the provider
Credits are automatically refunded when a task fails due to upstream errors.