This document introduces the SeeDream Images Generation API integration guide, which allows you to generate official SeeDream images by inputting custom parameters.Documentation Index
Fetch the complete documentation index at: https://docs.xhuoapi.ai/llms.txt
Use this file to discover all available pages before exploring further.
Application Process
To use the API, you need to apply for the corresponding service on the SeeDream Images Generation API page. After entering the page, click the “Acquire” button, as shown below:
If you are not logged in or registered, you will be automatically redirected to the login page to register and log in. After logging in or registering, you will be automatically returned to the current page.
There is a free quota granted upon the first application, allowing you to use the API for free.
Basic Usage
First, understand the basic usage method, which is to input the promptprompt, generation action action, and image size size to get the processed result. You need to simply pass an action field with the value generate, and then input the prompt. The details are as follows:

accept: The desired response format, here set toapplication/json, i.e., JSON format.authorization: The API key for calling the API, which can be selected from a dropdown after application.
prompt: The prompt text.model: The generation model, default isdoubao-seedream-5.0-lite. Supported models includedoubao-seedream-5.0-lite(latest),doubao-seedream-4.5,doubao-seedream-4.0,doubao-seedream-3.0-t2i, anddoubao-seededit-3.0-i2i.image: Input image information, supports URL or Base64 encoding. Among them,doubao-seedream-5.0-lite,doubao-seedream-4.5, anddoubao-seedream-4.0support single or multiple image inputs,doubao-seededit-3.0-i2isupports only single image input, anddoubao-seedream-3.0-t2idoes not support this parameter.size: Specifies the size of the generated image, supporting two mutually exclusive methods. Method 1 | Specify the resolution of the generated image and describe the aspect ratio in natural language within the prompt. Each model supports different presets:doubao-seedream-5.0-litesupports2K/3K/4K;doubao-seedream-4.5supports only2K/4K;doubao-seedream-4.0supports1K/2K/4K;doubao-seedream-3.0-t2ianddoubao-seededit-3.0-i2ido not support presets, only accept method 2. Method 2 | Specify the width and height in pixels: default is2048x2048. The total pixels and aspect ratio range vary by model (e.g., 5.0 / 4.5 minimum total pixels 3,686,400, 4.0 minimum 921,600, 3.0-t2i / seededit-3.0-i2i range [512x512, 2048x2048]).seed: Random seed to control the randomness of the model output. Range is [-1, 2147483647]. Only supported bydoubao-seedream-3.0-t2i.sequential_image_generation: Group images: generates a set of related images based on your input content. Supported bydoubao-seedream-5.0-lite,doubao-seedream-4.5, anddoubao-seedream-4.0, default isdisabled.stream: Controls whether to enable streaming output mode. Supported bydoubao-seedream-5.0-lite,doubao-seedream-4.5, anddoubao-seedream-4.0, default isfalse.guidance_scale: Degree of consistency between the model output and the prompt; higher values mean stronger relevance. Range [1, 10]. Default is 2.5 fordoubao-seedream-3.0-t2i, 5.5 fordoubao-seededit-3.0-i2i, not supported by other models.response_format: Specifies the return format of the generated image. Default isurl, also supportsb64_json.watermark: Whether to add a watermark to the generated image. Default istrue.output_format: Specifies the file format of the generated image, supportsjpeg(default) andpng. Only supported bydoubao-seedream-5.0-lite.tools: Configures tools the model should call, currently supportsweb_search(online search). Only supported bydoubao-seedream-5.0-lite.callback_url: URL for callback results.

success: The status of the image generation task.task_id: The ID of the image generation task.trace_id: The trace ID of the image generation.data: The list of image generation task results.image_url: The link to the generated image.prompt: The prompt text.size: The pixel size of the generated image.
data field.
If you want to generate corresponding integration code, you can directly copy the generated code. For example, the CURL code is as follows:
Image Editing Task
If you want to edit an image, the parameterimage must include the link of the image to be edited.
- model: The model used for this image editing task.
doubao-seedream-5.0-lite,doubao-seedream-4.5, anddoubao-seedream-4.0support single or multiple image inputs;doubao-seededit-3.0-i2isupports only single image input. - image: Upload the image(s) to be edited, one or multiple.

Asynchronous Callback
Because the SeeDream Images Generation API takes relatively long to generate images, about 1-2 minutes, if the API does not respond for a long time, the HTTP request will keep the connection open, causing extra system resource consumption. Therefore, this API also supports asynchronous callbacks. The overall process is: when the client initiates a request, it additionally specifies acallback_url field. After the client sends the API request, the API immediately returns a result containing a task_id field, representing the current task ID. When the task is completed, the generated image result will be sent via POST JSON to the client-specified callback_url, which also includes the task_id field, so the task result can be correlated by ID.
Let’s understand the specific operation through an example.
After clicking run, you will immediately get a result as follows:
task_id field, and other fields are similar to above. This field allows task correlation.
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.

