Theme
Doubao image generation
Doubao Seedream models use the unified image generation endpoint. Suited to text-to-image, and also supports image-to-image via an array of references.
http
POST /v1/images/generationsChoose the Seedream model with ; sizes map from aspect ratios to concrete pixel values (see the size mapping table below). Responses follow an OpenAI Images–compatible shape.
Available models
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Request authentication. Use a Bearer Token, for example: | |
| string | Yes | Request content type; must be |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Doubao Seedream model name; see Available models above | |
| string | Yes | Generation prompt. Recommended for both text-to-image and image-to-image | |
| integer | No | Number of images; recommend . If omitted or explicitly set to , the unified layer falls back to | |
| string | No | Output size as width×height pixels. These Doubao models usually map fixed aspect ratios to fixed pixel sizes; see Size mapping below | |
| array<string> | string | No | Optional reference image input: image URLs or a Base64 array; for image-to-image and multi-reference cases | |
| string | No | Optional response format, commonly or . If omitted, the final format depends on upstream and the gateway compatibility layer | |
| string | No | Quality field. Accepted by the unified image DTO; whether it is consumed depends on the final upstream | |
| string | object | No | Style field. Accepted by the unified image DTO; whether it takes effect depends on the Doubao channel | |
| string | object | No | Background control field. Accepted by the unified image DTO; whether it takes effect depends on the Doubao channel | |
| boolean | No | Explicit watermark switch. differs from omitting the field |
Size mapping
| Aspect ratio | value |
|---|---|
Request example
bash
curl -X POST https://octopusx.ai/v1/images/generations \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4-0-250828",
"prompt": "A cute little sea otter floating on the ocean surface in sunlight, cinematic look, high-definition detail",
"n": 1,
"size": "2048x2048"
}'bash
curl -X POST https://octopusx.ai/v1/images/generations \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-4-5-251128",
"prompt": "Keep the subject and mood from the reference, and redraw as a more premium ad poster",
"n": 1,
"size": "2560x1440",
"image": [
"BASE64_IMAGE_1",
"https://example.com/reference-2.png"
]
}'Response example
json
{
"created": 1735689600,
"data": [
{
"url": "https://.../images/doubao-img-abc123.png",
"revised_prompt": "A cute little sea otter floating on the ocean surface in sunlight, cinematic look, high-definition detail"
}
]
}json
{
"created": 1735689600,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
"revised_prompt": "A cute little sea otter floating on the ocean surface in sunlight, cinematic look, high-definition detail"
}
]
}Response fields
| Name | Type | Description |
|---|---|---|
| integer | Generation timestamp | |
| array<object> | Array of generation results | |
| string | Returned image URL | |
| string | Returned image Base64 data | |
| string | Some upstreams return a revised prompt |
Notes
INFO
Unlike Gemini, these Doubao endpoints do not take an aspect-ratio enum. Map the ratio to a concrete pixel size first, then set that size on .