Application Process
To use the API, you need to first apply for the corresponding service on the SeeDream Images Generation API page. After entering the page, click the “Acquire” button, as shown in the image below:
If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page.
There is a free quota available for first-time applicants, allowing you to use the API for free.
Basic Usage
First, understand the basic usage method, which involves inputting the promptprompt, the action action, and the image size size to obtain the processed result. You first need to simply pass a field action with the value generate, and then we also need to input the prompt, as detailed below:

accept: The format of the response result you want to receive, filled in asapplication/json, which means JSON format.authorization: The API key for calling the API, which can be directly selected after application.
prompt: The prompt.model: The generation model, defaulting todoubao-seedream-4.0.image: The input image information, supporting URL or Base64 encoding. Among them,doubao-seedream-4.5,doubao-seedream-4.0support single or multiple image inputs, whiledoubao-seededit-3.0-i2ionly supports single image input, anddoubao-seededit-3.0-t2idoes not support this parameter.size: Specifies the size information of the generated image, supporting the following two methods, which cannot be mixed. Method 1 | Specify the resolution of the generated image and describe the image aspect ratio, shape, or purpose in natural language in the prompt, with the model ultimately determining the size of the generated image. Method 2 | Specify the pixel values for the width and height of the generated image: default value:2048x2048, which varies based on the model.seed: Random number seed used to control the randomness of the content generated by the model. The range is [-1, 2147483647]. Onlydoubao-seedream-3.0-t2i,doubao-seededit-3.0-i2isupport this parameter.sequential_image_generation: Group images: a set of related images generated based on your input. Onlydoubao-seedream-4.5,doubao-seedream-4.0support this parameter, defaulting todisabled.stream: Controls whether to enable streaming output mode. Onlydoubao-seedream-4.5,doubao-seedream-4.0support this parameter, defaulting tofalse.guidance_scale: The degree of consistency between the model output and the prompt, the degree of freedom in generating images, also known as text weight; the larger the value, the smaller the model’s degree of freedom, and the stronger the correlation with the user’s input prompt. The range is [1, 10].doubao-seedream-3.0-t2idefault value is 2.5,doubao-seededit-3.0-i2idefault value is 5.5, others do not support.response_format: Specifies the return format of the generated image. The default isurl, and it also supportsb64_json.watermark: Whether to add a watermark to the generated image. The default istrue.callback_url: The URL to which the result needs to be sent back.

success: The status of the video generation task at this time.task_id: The ID of the video generation task at this time.trace_id: The tracking ID of the video generation at this time.data: The result list of the image generation task at this time.image_url: The link to the image generation task at this time.prompt: The prompt.size: The pixel size of the generated image.
data in the result.
Additionally, if you want to generate the corresponding integration code, you can directly copy the generated code, for example, the CURL code is as follows:
Edit Image Task
If you want to edit a specific image, the parameterimage must first pass in the link of the image to be edited.
- model: The model used for this image editing task, which currently supports
doubao-seedream-4.5,doubao-seedream-4.0for single or multiple image inputs, anddoubao-seededit-3.0-i2ionly supports single image input. - image: Upload the image(s) that need to be edited, either one or multiple.

Asynchronous Callback
Due to the relatively long generation time of the SeeDream Images Generation API, which takes about 1-2 minutes, if the API does not respond for a long time, the HTTP request will keep the connection open, leading to additional system resource consumption. Therefore, this API also provides support for asynchronous callbacks. The overall process is: when the client initiates a request, an additionalcallback_url field is specified. After the client initiates the API request, the API will immediately return a result containing a task_id field, representing the current task ID. When the task is completed, the generated image result will be sent to the client-specified callback_url in the form of a POST JSON, which also includes the task_id field, allowing the task result to be associated by ID.
Let’s understand how to operate specifically through an example.
Clicking run, you can find that you will immediately get a result, as follows:
task_id field, and the other fields are similar to the above text. The task can be associated through this field.
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.

