Doubao Seedream Image Generation API
Use `POST /v1/images/generations` to call the Doubao Seedream series image generation endpoint.
https://zx1.deepwl.net/v1/images/generationscurl -X POST https://zx1.deepwl.net/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "doubao-seedream-4-0-250828",
"prompt": "A cute little sea otter floating on the sea under sunlight, cinematic, high-detail",
"n": 1,
"size": "2048x2048"
}'{
"created": 1735689600,
"data": [
{
"url": "https://.../images/doubao-img-abc123.png",
"revised_prompt": "A cute little sea otter floating on the sea under sunlight, cinematic, high-detail"
}
]
}The Doubao Seedream series sends requests through the unified image generation entry point (POST /v1/images/generations), which is suitable for text-to-image and also supports image-to-image via the image array to pass reference images.
- 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
Request Headers
Authorizationstring必填Authentication header. Uses a Bearer token, e.g. Bearer YOUR_API_KEY.
Content-Typestring必填Request content type, must be application/json.
Request Body
modelstring必填The Doubao Seedream model name. Common values include doubao-seedream-4-0-250828, doubao-seedream-4-5-251128, and doubao-seedream-5-0-260128.
promptstring必填Generation prompt. It is recommended to pass this explicitly for both text-to-image and image-to-image.
nintegerNumber 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.
sizestringOutput size, passed directly as width and height pixel values. These Doubao models are typically mapped to fixed pixel sizes based on fixed ratios.
imagearray<string> | stringOptional 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.
response_formatstringOptional 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.
qualitystringQuality field. The unified image DTO supports accepting it, but whether Doubao actually consumes this field depends on the final upstream service.
stylestring | objectStyle field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.
backgroundstring | objectBackground control field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.
watermarkbooleanExplicit 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's DOUBAO_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 |
Request Examples
Response Examples
Response Fields
createdintegerGeneration timestamp.
dataarray<object>Array of generation results.
urlstringReturned image URL. When the current plugin encounters this field, it will download the image locally again.
b64_jsonstringReturned image Base64 data. The current plugin will preferentially use this field.
revised_promptstringSome upstream services return an adjusted prompt.