Doubao Seedream Image Generation API
Doubao Seedream
Doubao Seedream Image Generation API
Use POST /v1/images/generations to call the Doubao Seedream series image generation endpoint.
POST
Doubao Seedream Image Generation API
Doubao Seedream Image Generation API
The Doubao Seedream series sends requests through a unified image generation entry point, which is suitable for text-to-image and also supports image-to-image via theimage array to pass reference images.
- The unified entry point is
POST /v1/images/generations. - Pass the specific Seedream model name in
model. - Pass the pixel dimension string directly in
size, for example2048x2048or2560x1440. imagesupports image URLs or Base64 arrays, making it suitable for image-to-image and multi-reference-image scenarios.- Responses are usually compatible with the OpenAI Images style, commonly
urlorb64_json.
Currently Available Models
doubao-seedream-4-0-250828seedream-4-0-250828doubao-seedream-4-5-251128doubao-seedream-5-0-260128
Method and Path
Request Example
Image-to-Image Example
Response Example
Authentication
Body
The Doubao Seedream model name. Common values include
doubao-seedream-4-0-250828, doubao-seedream-4-5-251128, and doubao-seedream-5-0-260128.Generation prompt. It is recommended to pass this explicitly for both text-to-image and image-to-image.
Number of images to generate. The Apifox you provided treats this as required; from the existing unified image DTO, this field is an optional pointer type in the gateway. To keep behavior consistent with the current plugin, it is recommended to pass
1.Output size, passed directly as width and height pixel values. These Doubao models are typically mapped to fixed pixel sizes based on fixed ratios.
Optional reference image input. Your Apifox definition describes this as “image URL or BASE64 array”; the current plugin also encodes reference images into a Base64 array and puts them in this field.
Optional response format. Common values are
url and b64_json. If omitted, the final response format depends on the upstream service and the gateway compatibility layer.Quality field. The unified image DTO supports accepting it, but whether Doubao actually consumes this field depends on the final upstream service.
Style field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.
Background control field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.
Explicit watermark switch. In the current unified image DTO, this field uses a pointer type, and
false is semantically different from omitting it.Size Mapping
Your Apifox is consistent with the plugin’sDOUBAO_SIZE_MAP, so you can use the table below:
| Aspect Ratio | size Value |
|---|---|
1:1 | 2048x2048 |
4:3 | 2304x1728 |
3:4 | 1728x2304 |
16:9 | 2560x1440 |
9:16 | 1440x2560 |
3:2 | 2496x1664 |
2:3 | 1664x2496 |
21:9 | 3024x1296 |
Unlike Gemini, the interfaces in this Doubao series do not pass a “ratio enum” in your existing plugin. Instead, the ratio is first mapped to a specific pixel size, and that size is then written into
size.Text-to-Image vs Image-to-Image
| Scenario | Key Fields | Description |
|---|---|---|
| Text-to-image | prompt + size | The most basic usage |
| Image-to-image | prompt + size + image | image can contain one or more reference images |
Response
Generation timestamp.
Returned image URL. When the current plugin encounters this field, it will download the image locally again.
Returned image Base64 data. The current plugin will preferentially use this field.
Some upstream services return an adjusted prompt.