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 NameOutputMode
doubao-seedream-5.0-liteImage URLsText-to-image, image references, sequential generation, web search
doubao-seedream-4.5Image URLsText-to-image, image references, sequential generation

Pricing

Priced by successfully generated images. Failed images are not charged.

ModelCredits
doubao-seedream-5.0-lite15 credits/image
doubao-seedream-4.515 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

FieldTypeRequiredDescription
modelstringYesdoubao-seedream-5.0-lite or doubao-seedream-4.5
inputobjectYesGeneration parameters, see below
callback_urlstringNoOptional callback URL for completion/failure notifications

Input Parameters

FieldTypeRequiredDescription
promptstringYesImage generation prompt. Chinese and English are supported.
image_urlsstring[]NoPublic HTTP(S) reference image URLs. Base64 input is not supported. 1-14 images when provided.
sizestringNoOutput size, defaults to 2048x2048. Use a resolution tier or pixel size; see Size & Resolution.
sequential_image_generationstringNoSequential generation mode, defaults to disabled. One of: disabled, auto.
sequential_image_generation_optionsobjectNoSequential generation options. Only used when sequential_image_generation=auto.
toolsarrayNoOnly supported by doubao-seedream-5.0-lite. Use [{ "type": "web_search" }].
streambooleanNoWhether to request upstream streaming, defaults to false. The platform still returns final images through the task result.
output_formatstringNoOnly supported by doubao-seedream-5.0-lite. One of: jpeg, png. Defaults to jpeg.
watermarkbooleanNoWhether to add a watermark, defaults to true.
optimize_prompt_optionsobjectNoPrompt optimization options. Currently supports { "mode": "standard" }.

doubao-seedream-4.5 does not support 3K, tools, or output_format.

Reference Image Limits

LimitRequirement
Image formatsjpeg, png, webp, bmp, tiff, gif, heic, heif
File sizeUp to 30 MB per image
Total pixelsUp to 6000×6000 per image
Width and heightBoth must be greater than 14 px
Aspect ratio[1/16, 16]
Multi-image referenceUp 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].

ModelSupported TiersDefault
doubao-seedream-5.0-lite2K, 3K, 4K2048x2048
doubao-seedream-4.52K, 4K2048x2048

Common sizes:

ResolutionAspect RatioPixel Size
2K1:12048x2048
2K4:32304x1728
2K3:41728x2304
2K16:92848x1600
2K9:161600x2848
2K3:22496x1664
2K2:31664x2496
2K21:93136x1344
3K1:13072x3072
3K4:33456x2592
3K3:42592x3456
3K16:94096x2304
3K9:162304x4096
3K3:23744x2496
3K2:32496x3744
3K21:94704x2016
4K1:14096x4096
4K4:34704x3520
4K3:43520x4704
4K16:95504x3040
4K9:163040x5504
4K3:24992x3328
4K2:33328x4992
4K21:96240x2656

3K is only supported by doubao-seedream-5.0-lite.

Sequential Generation

sequential_image_generation controls whether to generate an image set:

ValueDescription
disabledDisable sequential generation and generate one image.
autoLet the model decide whether to return an image set and how many images to generate.

sequential_image_generation_options supports:

FieldTypeRequiredDescription
max_imagesintegerNoMaximum 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"
    }
  }'
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 StatusCodeTypeDescription
400invalid_requestinvalid_request_errorMissing or invalid parameters
401invalid_api_keyauthentication_errorAPI key is invalid, disabled, or deleted
402insufficient_creditsbilling_errorCredit balance too low, please top up
403ip_not_allowedpermission_errorRequest IP not in the key's allowlist
404model_not_foundinvalid_request_errorModel does not exist or is inactive
404task_not_foundinvalid_request_errorTask ID does not exist
429rate_limit_exceededrate_limit_errorToo many requests, please slow down
429spend_limit_exceededbilling_errorKey spend limit reached (hourly/daily/total)
500internal_errorapi_errorUnexpected server error
503upstream_errorupstream_errorUpstream 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.