SeeDream Images Generation API Integration Guide
This article introduces how to integrate with the SeeDream Images Generation API, which can generate official SeeDream images by entering custom parameters.
¶ Application Process
To use the SeeDream Images Generation API, first go to the Ace Data Cloud Console to obtain your API Token for later use.

If you have not logged in or registered, you will be automatically redirected to the login page to register and log in. Once completed, you will be automatically returned to the current page.
A general application's API Key can be used for services enabled for the account; a dedicated application's Key can be used within that application's service scope. Please check the Key's permissions, validity period, and limits, and confirm that the application balance is sufficient to pay for this request. Available trial credits are subject to what is displayed in the account. If the balance is insufficient, click the "Recharge" button.
📘 Full documentation: SeeDream Images Generation API →
¶ Model Selection
| Model | Use Cases |
|---|---|
doubao-seedream-5-5-261028 |
Multi-turn editing, text-to-transparent-image generation, transparent editing with multiple reference images, layer decomposition, and text layer recognition |
doubao-seedream-5-0-flash-260915 |
Low-latency single-image generation, editing with multiple reference images, transparent image editing, and layer decomposition |
doubao-seedream-5-0-pro-260628 |
Single-image generation, fine editing, transparent image editing, and layer decomposition |
doubao-seedream-5-0-lite-260128 |
Single images, image sets, streaming output, and web search |
doubao-seedream-4-5-251128 / doubao-seedream-4-0-250828 |
Legacy image generation and editing |
5.5 and 5.0 Flash use the same POST /seedream/images endpoint, and both support 1K, 1.5K, 2K, and up to 10 reference images. Layer decomposition tasks for both models accept only one image and return URLs. For 5.5, you can set layer_decomposition_options: {"max_images": 12, "text_recognition": true}. Up to 100 images can be output, including the base image, and recognized text layers return line-by-line text and styles in data[].text_recognition. 5.0 Flash returns a maximum of 1 base image and 16 layers.
5.5 supports direct generation of transparent PNGs using background: "transparent". Transparent image editing with 5.0 Flash requires a reference image with a transparency channel. 5.5 is charged based on the pixel tier of each successfully output image, with an additional 0.13 Credits charged per input reference image. 5.0 Flash charges 0.31 Credits per successfully output image, and reference images are free. Layer decomposition is billed based on the actual number of successfully output images, including the base image. See live pricing.
¶ Basic Usage
First, let's look at the basic usage: enter the prompt prompt, generation action action, and image size size to obtain the processed result. First, simply pass an action field with the value generate, then enter the prompt. The details are as follows:

As you can see, we have set the Request Headers here, including:
accept: The desired format of the response. Enterapplication/jsonhere for JSON format.authorization: The key for calling the API, which can be selected directly from the drop-down list after applying.
The Request Body is also set, including:
prompt: The prompt.model: Please provide the full model ID from the table above.image: Input image URL, Base64 string, or array. 5.5, 5.0 Pro, and 5.0 Flash support up to 10 reference images.size: Resolution tier orwidth x height. 5.5, 5.0 Pro, and 5.0 Flash support1K,1.5K, and2K. 5.0 Lite supports2K,3K, and4K.sequential_image_generation: Image set: a set of related images generated based on your input.doubao-seedream-5-0-lite-260128,doubao-seedream-4-5-251128, anddoubao-seedream-4-0-250828support this parameter. The default isdisabled.stream: Controls whether streaming output mode is enabled.doubao-seedream-5-0-lite-260128,doubao-seedream-4-5-251128, anddoubao-seedream-4-0-250828support this parameter. The default isfalse.response_format: Specifies the return format of the generated image. The default isurl, andb64_jsonis also supported.watermark: Whether to add a watermark to the generated image. The default istrue.output_format: The output format isjpegorpng. 5.5 defaults to PNG, while 5.0 Pro/Flash/Lite default to JPEG.tools: Configures the tools the model will call. Currently,web_search(web search) is supported. Only Seedream 5.0 Lite supports this parameter.optimize_prompt_options: Prompt optimization configuration. 5.0 Pro supportsstandard/fast; 5.5, 5.0 Flash, 5.0 Lite, and 4.5 only supportstandard; 4.0 supportsstandard/fast.background: Supportstransparentandopaque. 5.5 also supportsauto. Transparent output uses PNG.layer_decomposition: Supported by 5.5, 5.0 Pro, and 5.0 Flash. When set totrue, one PNG/JPEG image must be provided. You can omitpromptfor automatic decomposition, or specify elements using natural language/<bbox>;sizesupportsauto/1K/1.5K/2K. This mode cannot be used with image sets, streaming, web search, orbackground.callback_url: The URL to which results should be sent.async: Whether to process in asynchronous mode. When set totrue, the API immediately returns atask_idwithout requiringcallback_url, and the result can then be retrieved by polling/seedream/tasks.
After making your selections, you can see that the corresponding code has also been generated on the right, as shown below:

Click the "Try" button to test. As shown above, we obtained the following result:
{
"success": true,
"task_id": "80ceeed1-17d4-4eb7-82e0-18b34290f36e",
"trace_id": "96b7fdc8-0fc8-4e2e-82a9-83c0a82f0a08",
"data": [
{
"prompt": "A single matte blue cube centered on a clean white studio background, neutral lighting",
"size": "2048x2048",
"image_url": "https://cdn.acedata.cloud/assets/examples/seedream/db93b46e-c302-4676-8a11-63f0ba638a27-1c6f66f6b7e8.jpg"
}
]
}
The returned result contains multiple fields, described below:
success, the status of the video generation task.task_id, the video generation task ID.trace_id, the video generation trace ID.data, the list of results from the image generation task.image_url, the link for the image generation task.prompt, the prompt.size: the pixel dimensions of the generated image
As you can see, we have obtained satisfactory image information. We only need to use the image link in data from the result to retrieve the generated SeeDream image.
Additionally, if you want to generate the corresponding integration code, you can copy it directly. For example, the CURL code is as follows:
curl -X POST 'https://api.acedata.cloud/seedream/images' \
-H 'accept: application/json' \
-H 'authorization: Bearer ${token}' \
-H 'content-type: application/json' \
-d '{
"action": "generate",
"model": "doubao-seedream-5-0-lite-260128",
"prompt": "A single matte blue cube centered on a clean white studio background, neutral lighting"
}'
¶ Image Editing Task
If you want to edit an image, you must first pass the link to the image to be edited in the image parameter.
- model: Pass the full ID of a model that supports image editing from the table above.
- image: Upload one or more images to be edited.
An example is shown below:

The corresponding code:
import requests
url = "https://api.acedata.cloud/seedream/images"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}",
"content-type": "application/json"
}
payload = {
"model": "doubao-seedream-4-0-250828",
"prompt": "Keep the model pose and the liquid garment flowing shape unchanged. Change the clothing material from silver metal to completely transparent water (or glass). Through the liquid flow, the details of the model skin are visible. The light and shadow effect shifts from reflection to refraction.",
"image": ["https://ark-project.tos-cn-beijing.volces.com/doc_image/seedream4_5_imageToimage.png"],
"size": "2K",
"watermark": False
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
Click Run, and you will immediately receive a result, as follows:
{
"success": true,
"task_id": "c9aaffa2-b8ac-40ff-8468-43e77cb9ddde",
"trace_id": "131a40c3-2eaf-44c9-af28-c9b408577286",
"data": [
{
"prompt": "Keep the model pose and the liquid garment flowing shape unchanged. Change the clothing material from silver metal to completely transparent water (or glass). Through the liquid flow, the details of the model skin are visible. The light and shadow effect shifts from reflection to refraction.",
"size": "2048x2048",
"image_url": "https://platform.cdn.acedata.cloud/seedream/3e88db7e-4771-4f6a-adbd-5ae4590c5d59.jpg"
}
]
}
As you can see, the generated output is an edited version of the original image, and the result is similar to the one above.
¶ Layer Decomposition (Seedream 5.0 Pro)
Layer decomposition splits an input image into one base image and up to 16 independently editable transparent PNG layers. The following request lets the model automatically identify the main elements; to specify elements, you can add a prompt or use normalized <bbox> coordinates in the prompt.
curl -X POST 'https://api.acedata.cloud/seedream/images' \
-H 'accept: application/json' \
-H 'authorization: Bearer ${token}' \
-H 'content-type: application/json' \
-d '{
"model": "doubao-seedream-5-0-pro-260628",
"image": "https://example.com/poster.png",
"layer_decomposition": true,
"size": "2K",
"watermark": false
}'
The returned data is arranged from bottom to top by z_index. The base image has a z_index of 0; the layers also include name, description, and bounding_box.absolute/normalized. When reassembling using absolute coordinates, scale each layer to [right-left, bottom-top], place it at [left, top], and stack the layers in ascending z_index order. If any layer fails to generate, the entire decomposition fails.
¶ Streaming Output
When stream: true is set for Lite/4.x, use accept: application/x-ndjson in the request header. The API returns image_generation.partial_succeeded or image_generation.partial_failed line by line, and finally returns a single image_generation.completed event and the final usage; billing occurs only once, when the completion event is triggered. Streaming mode cannot be used with async or callback_url.
¶ Asynchronous Callback
Since the SeeDream Images Generation API takes relatively long to generate images, approximately 1–2 minutes, if the API does not respond for a long time, the HTTP request will keep the connection open, causing additional system resource consumption. Therefore, this API also provides support for asynchronous callbacks.
The overall process is as follows: when the client initiates a request, it additionally specifies a callback_url field. After the client initiates the API request, the API immediately returns a result containing a task_id field, which represents the current task ID. Once the task is completed, the generated image result is sent as POST JSON to the callback_url specified by the client, also including the task_id field, so that the task result can be associated using the ID.
If you do not have a public address available for callbacks, you can also omit callback_url and set the async field to true in the request instead. The API will likewise immediately return a task_id, but it will not push the result. You will need to use that task_id to call the /seedream/tasks API and poll the task status to obtain the final result.
Below, we will use an example to understand how to do this.
Click Run, and you will immediately receive a result, as follows:
{
"task_id": "c9aaffa2-b8ac-40ff-8468-43e77cb9ddde"
}
The content is as follows:
{
"success": true,
"task_id": "c9aaffa2-b8ac-40ff-8468-43e77cb9ddde",
"trace_id": "131a40c3-2eaf-44c9-af28-c9b408577286",
"data": [
{
"prompt": "Keep the model pose and the liquid garment flowing shape unchanged. Change the clothing material from silver metal to completely transparent water (or glass). Through the liquid flow, the details of the model skin are visible. The light and shadow effect shifts from reflection to refraction.",
"size": "2048x2048",
"image_url": "https://platform.cdn.acedata.cloud/seedream/3e88db7e-4771-4f6a-adbd-5ae4590c5d59.jpg"
}
]
}
You can see that the result contains a task_id field, while the other fields are similar to those above. This field can be used to associate tasks.
¶ Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:
400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.
¶ Error Response Example
{
"success": false,
"error": {
"code": "api_error",
"message": "fetch failed"
},
"trace_id": "2cf86e86-22a4-46e1-ac2f-032c0f2a4e89"
}
¶ Conclusion
Through this document, you have learned how to use the SeeDream Images Generation API to generate images by entering prompts. We hope this document helps you better integrate and use the API. If you have any questions, please feel free to contact our technical support team.
