Skip to content

ByteDance Seedream

Seedream models on sale: seedream-5.0-pro and seedream-5.0-lite. They are served by Volcengine (Doubao) channels and called through the same OpenAI-compatible images endpoints described on OpenAI Image Format; this page covers what the Volcengine adaptor changes.

Seedream models have image-generation in supported_endpoint_types — see Models for reading that field.

POST /v1/images/generations
POST /v1/images/edits

/v1/images/generations takes a JSON body. Image-to-image editing uses /v1/images/edits with the source image passed as a string in image; RouteAPI forwards both to the upstream image generation endpoint (Volcengine exposes no separate form-based edit endpoint through this channel).

FieldTypeRequiredDescription
modelstringYesseedream-5.0-pro or seedream-5.0-lite
promptstringYesText description or edit instruction
sizestringNoOutput size or tier. Normalized before it reaches Volcengine (see Size normalization)
imagestringNoSource image for image-to-image, as an http(s) URL or a data:image/...;base64,... string. Send it in a JSON body
watermarkbooleanNoWhether to watermark the output; an explicit false is forwarded
sequential_image_generationstringNo"auto" enables multi-image generation; "disabled" turns it off
sequential_image_generation_optionsobjectNoOptions for sequential generation; {"max_images": <int>} sets the count
layer_decompositionbooleanNoSplit the result into layers. When enabled it also changes how the request is priced (see Billing)
backgroundstringNoBackground handling, for example "transparent" or "opaque"
toolsarrayNoUpstream tools such as [{"type": "web_search"}]
optimize_prompt_optionsobjectNoPrompt optimization, for example {"mode": "standard"} or {"mode": "fast"}

These fields are part of the gateway’s image request struct and are forwarded to Volcengine. Optional fields you leave out are omitted from the upstream body rather than sent as null. Other unknown JSON fields are dropped — use request-body passthrough on the channel if you need a field the gateway does not model.

How size is treated depends on the model:

Modelsize handling
seedream-5.0-proNative sizes are kept as sent: 1K, 1.5K, pixel strings such as 1024x1024, and other values
seedream-5.0-liteAlgebraic sizes are rewritten to a 2K / 3K / 4K tier

For models that are rewritten, the long side decides the tier: it is divided by 1024 and rounded to the nearest integer (ties round up), then clamped to the 2K–4K range. Tiers sent directly, such as 2K or 3k, are only clamped, and unrecognized values such as auto are passed through for Volcengine to validate. Examples for seedream-5.0-lite:

Requested sizeSent upstream
1024x10242K
2048x20482K
1536x15362K
1440x25603K
3840x21604K
1K2K
5K4K
autoauto
Terminal window
curl https://api.routeapi.ai/v1/images/generations \
-H "Authorization: Bearer $ROUTEAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.0-pro",
"prompt": "A misty mountain lake at sunrise, cinematic",
"size": "2K"
}'
Terminal window
curl https://api.routeapi.ai/v1/images/generations \
-H "Authorization: Bearer $ROUTEAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.0-lite",
"prompt": "A series of four postcards from the same coastal town, consistent style",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 4 }
}'

When sequential_image_generation is "auto" and no max_images is given, cost pre-estimation plans for 15 images if the model has extra-output pricing configured.

Send the source image as a string in the JSON body. The gateway forwards the image value to Volcengine unchanged — an http(s) URL or a data:image/...;base64,... string. The size normalization above still applies to the edit request.

Terminal window
curl https://api.routeapi.ai/v1/images/edits \
-H "Authorization: Bearer $ROUTEAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-5.0-pro",
"prompt": "Replace the background with a sunset beach, keep the subject unchanged",
"image": "https://example.com/photo.png",
"size": "2K"
}'

layer_decomposition: true asks the upstream to split the result into separate layers; background: "transparent" asks for a transparent background. Both are forwarded unchanged.

The upstream images object is passed through to you. The fields you can parse are:

{
"data": [
{
"url": "https://example.com/generated.png",
"size": "2048x2048"
}
],
"usage": {
"input_images": 1,
"generated_images": 1,
"output_tokens": 4096,
"total_tokens": 4096
}
}
  • Read images from data[].url. Each entry may report the delivered size, which can differ from the tier you requested.
  • usage.input_images and usage.generated_images are used for settlement when the model is priced per image; output_tokens feeds token-based settlement.

Seedream models are priced per image when the model is configured that way. If the model detail page shows size tiers, the tier is chosen from the pixel count of the size you send, before a channel is selected. See Model Pricing and the model detail page for the price that applies.

Two Seedream-specific points:

  • The adaptor rewrites size for seedream-5.0-lite, so the delivered image can land in a different tier than the one billed. To protect against that mismatch, size-tier-priced models are rejected with 400 when they route to a Volcengine channel — passthrough-body mode is exempt because the adaptor does not rewrite the body then.
  • layer_decomposition: true switches the request to the layer-decomposition price configuration, where the model has one. Reference images beyond the free allowance and sequential outputs are also billed; the model detail page lists the numbers that apply.
StatusMeaningTypical cause
400Invalid requestmodel missing, n above 128, × used as the size separator in a JSON body, or a size-tier-priced model routed to Volcengine
401Authentication failedMissing, invalid, expired, or exhausted API Key
403Balance or quota exhaustedinsufficient_user_quota or pre_consume_token_quota_failed
429Rate limitedReduce concurrency
500Conversion or internal errorThe request could not be converted, or the upstream returned no image

Upstream errors such as an unsupported size or a rejected prompt come back with the upstream’s status and message, with the RouteAPI request ID appended.