Skip to content

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/generations

Choose 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

NameTypeRequiredDescription
stringYesRequest authentication. Use a Bearer Token, for example:
stringYesRequest content type; must be

Request body

NameTypeRequiredDescription
stringYesDoubao Seedream model name; see Available models above
stringYesGeneration prompt. Recommended for both text-to-image and image-to-image
integerNoNumber of images; recommend . If omitted or explicitly set to , the unified layer falls back to
stringNoOutput size as width×height pixels. These Doubao models usually map fixed aspect ratios to fixed pixel sizes; see Size mapping below
array<string> | stringNoOptional reference image input: image URLs or a Base64 array; for image-to-image and multi-reference cases
stringNoOptional response format, commonly or . If omitted, the final format depends on upstream and the gateway compatibility layer
stringNoQuality field. Accepted by the unified image DTO; whether it is consumed depends on the final upstream
string | objectNoStyle field. Accepted by the unified image DTO; whether it takes effect depends on the Doubao channel
string | objectNoBackground control field. Accepted by the unified image DTO; whether it takes effect depends on the Doubao channel
booleanNoExplicit 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

NameTypeDescription
integerGeneration timestamp
array<object>Array of generation results
stringReturned image URL
stringReturned image Base64 data
stringSome 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 .