Docs / Image Series / Doubao Seedream / Sync - OpenAI Compatible
Seedream 5.5 Synchronous Image Generation
Call Doubao Seedream 5.5 synchronously through the OpenAI image endpoints POST /v1/images/generations and /v1/images/edits: text-to-image, multi-reference generation, transparent backgrounds and layer decomposition, with standard OpenAI Images requests and responses.
Overview#
Doubao Seedream 5.5 can be called synchronously through the OpenAI image endpoint POST /v1/images/generations: requests and responses use the standard OpenAI Images format, so OpenAI SDKs and image clients work without adaptation. The model supports text-to-image, image-to-image and multi-reference generation (up to 10 reference images), can directly output RGBA images with a transparent channel, and can split one image into a base image and multiple independently editable layers.
This endpoint is synchronous: the request waits for generation to finish and returns the result directly, with no task to poll.
The public model name for this page is doubao-seedream-5-5-261028. Output images are billed per image by pixel tier and input reference images are billed per image; see the platform Model Pricing page for the unit price.
Other ways to call the model: to submit a task and poll or wait for a callback, see Seedream 5.5 Image Generation; for the complete layer information (order, names, bounding boxes), or if you already integrate Volcengine Ark, see Native Seedream Format (Sync).
API#
| Endpoint | Description |
|---|---|
POST /v1/images/generations | Synchronous generation with a JSON body; reference images are passed as image URLs or Base64 |
POST /v1/images/edits | Synchronous generation with multipart/form-data file upload of reference images |
Requests must carry an API key:
Authorization: Bearer <token>
Content-Type: application/jsonSupported models#
| Model | Description |
|---|---|
doubao-seedream-5-5-261028 | Doubao Seedream 5.5 |
Request fields#
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Fixed as doubao-seedream-5-5-261028 |
prompt | string | Yes | — | Description of the image content and style. Keep it within 300 Chinese characters or 600 English words; state the aspect ratio in the prompt when you need a specific one, e.g. "16:9 landscape" |
size | string | No | 2K | Resolution tier or pixel size, see "Size" below |
image | string / string[] | No | — | Reference images: publicly accessible HTTP(S) URLs or data:image/<format>;base64,... (lowercase format name). At most 10 images, at most 30MB each |
response_format | string | No | url | url returns image links; b64_json returns Base64 image data |
output_format | string | No | png | png or jpeg |
background | string | No | auto | Transparency mode: auto, transparent or opaque, see "Transparent background" below |
watermark | boolean | No | true | Whether to add an "AI generated" watermark in the bottom-right corner of the image |
layer_decomposition | boolean | No | false | Whether to enable layer decomposition, see "Layer decomposition" below |
layer_decomposition_options | object | No | — | Layer decomposition settings: max_images (integer 2–100, default 30) and text_recognition (boolean, default false) |
This model generates 1 image per request (layer decomposition excepted), so n must be 1 or omitted. stream, mask and tools are not supported and return 400. Group generation is not supported, so do not send sequential_image_generation. quality and resolution have no effect on this model; set the resolution through size.
Size#
Two forms are supported and cannot be mixed:
- Resolution tier (recommended):
1K,1.5Kor2K, case-insensitive. The model decides the aspect ratio from the prompt; describe the ratio you need in the prompt. - Pixel size:
WIDTHxHEIGHT, such as1280x720or2880x1440. The total must be between 921,600 and 8,294,400 pixels (1280x720through2880x2880), and the aspect ratio must be between 1:16 and 16:1.
Reference pixel sizes of each tier at common aspect ratios (the actual size is decided by the model):
| Tier | 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 3:2 | 2:3 | 21:9 |
|---|---|---|---|---|---|---|---|---|
1K | 1024x1024 | 1152x864 | 864x1152 | 1424x800 | 800x1424 | 1248x832 | 832x1248 | 1568x672 |
1.5K | 1536x1536 | 1792x1344 | 1344x1792 | 2048x1152 | 1152x2048 | 1872x1248 | 1248x1872 | 2352x1008 |
2K | 2048x2048 | 2368x1776 | 1776x2368 | 2816x1584 | 1584x2816 | 2496x1664 | 1664x2496 | 3136x1344 |
Transparent background#
Set "background": "transparent" and keep output_format as png to get an RGBA image with a transparent background directly from text-to-image or image-to-image, which suits stickers, icons and product assets. Reference images do not need a transparent channel.
auto(default): the model decides from the prompt and output format.transparent: outputs an image with a transparent channel.opaque: outputs an image without a transparent channel.
background cannot be combined with output_format: jpeg. Do not send background with layer decomposition: layers are always PNG images with a transparent channel.
Layer decomposition#
Set "layer_decomposition": true and pass one image to split through image. The model splits it into 1 base image and up to 99 PNG layers with a transparent channel.
{
"model": "doubao-seedream-5-5-261028",
"prompt": "Split the poster into three layers: background, character and title text",
"layer_decomposition": true,
"layer_decomposition_options": { "max_images": 8 },
"image": "https://example.com/poster.png",
"size": "2K"
}layer_decomposition_options.max_images: the maximum total number of images returned by this request (base image included), 2–100, default 30. A larger value usually gives a finer split, and more quota is pre-held at submission.layer_decomposition_options.text_recognition: when set totrue, regular text layers also return their text content and style (rich-text OCR).- With layer decomposition,
sizeaccepts1K,1.5K,2Kandauto(default, the output follows the input image size). - If any layer fails to generate, the whole request fails; partial success is not supported.
The OpenAI-format endpoints return only the image links of the layers, without layer order, names, bounding boxes or OCR results. Use the native format endpoint POST /api/v3/images/generations when you need that layer information.
Request examples#
Text-to-image:
curl --request POST \
--url https://api.apimax.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "doubao-seedream-5-5-261028",
"prompt": "Cinematic wide shot of a futuristic city skyline at dusk, 16:9 landscape",
"size": "2K",
"response_format": "url"
}'Image-to-image and multi-reference generation. Pass reference images through image as a single string or an array of strings:
{
"model": "doubao-seedream-5-5-261028",
"prompt": "Combine the two characters into one poster, cyberpunk style",
"size": "2K",
"image": [
"https://example.com/person1.png",
"https://example.com/person2.png"
],
"response_format": "url"
}To edit the same image over several rounds, pass the image link returned by the previous round as image, and state in the prompt what to change this round and what to keep; also set "background": "opaque" for better consistency across rounds.
Uploading reference image files#
POST /v1/images/edits uses multipart/form-data. Reference images go in the file field image or image[], at most 10 images of at most 30MB each; the other parameters are sent as form fields, with booleans and numbers written as strings and object parameters as JSON strings.
curl --request POST \
--url https://api.apimax.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--form 'model=doubao-seedream-5-5-261028' \
--form 'prompt=Add a red knitted hat to the character and keep the background unchanged' \
--form 'size=1K' \
--form 'response_format=url' \
--form 'image=@./input.png'Response#
The endpoint returns the OpenAI Images format directly:
{
"created": 1794000000,
"data": [
{
"url": "https://example.com/generated-image.png"
}
]
}- With
response_formaturl(default),data[].urlholds the image link. Whether or notresponse_formatis sent,data[].urlis the upstream image link (the official Ark link), valid for 24 hours after generation; save it in time. - With
response_formatb64_json,data[].b64_jsonholds the Base64 image data. /v1/images/editsreturns upstream image links, valid for 24 hours after generation; save them in time.
Behavior#
- Synchronous wait: generation usually takes tens of seconds. If the synchronous wait times out, the endpoint answers 504; the task is not cancelled, it keeps running in the background and is billed by its actual result. Use the async endpoint for long-running requests.
- Content safety: when content is rejected by upstream moderation, generation fails and the endpoint answers 400, with the reason given by upstream in the error message.
- Billing: quota is pre-held at submission from the requested size and count and settled by the images actually returned; images that fail or are not returned are not charged.
Billing#
- Output images are billed per image by its actual pixels: up to 2.61 MP (the
1Kand1.5Ktiers), over 2.61 MP up to 4.63 MP (the2Ktier), and over 4.63 MP. Custom pixel sizes are tiered by the size of the returned image. - Input reference images are billed per image.
- Layer decomposition is billed per generated layer, each at its own tier.
- See the platform Model Pricing page for the unit price.
Common errors#
| HTTP | Description |
|---|---|
| 400 | Missing or invalid parameter, e.g. n other than 1, size outside the pixel range, more than 10 reference images, or stream or mask sent; or generation failed (including content rejected by upstream moderation) |
| 401 | API key missing or invalid |
| 403 | API key has no access to this model, or the account balance is insufficient |
| 429 | Too many requests, or the concurrency limit exceeded |
| 502 / 503 | Upstream returned an error or is temporarily unavailable; 503 also means no channel is available for this model in your group (for example a misspelled model name) |
| 504 | Timed out waiting for the synchronous generation. The task is not cancelled: it keeps running in the background and is billed by its actual result; use the async endpoint for long-running requests |

