POST
https://octopusx.ai
/
v1
/
images
/
generations
Doubao Seedream Image Generation API
curl --request POST \
  --url https://octopusx.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "n": 123,
  "size": "<string>",
  "image": [
    "<string>"
  ],
  "response_format": "<string>",
  "quality": "<string>",
  "style": {},
  "background": {},
  "watermark": true
}
'
{
  "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"
    }
  ]
}

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 the image 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 example 2048x2048 or 2560x1440.
  • image supports 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 url or b64_json.

Currently Available Models

  • doubao-seedream-4-0-250828
  • seedream-4-0-250828
  • doubao-seedream-4-5-251128
  • doubao-seedream-5-0-260128

Method and Path

POST /v1/images/generations

Request Example

curl -X POST https://octopusx.ai/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"
  }'

Image-to-Image Example

{
  "model": "doubao-seedream-4-5-251128",
  "prompt": "Preserve the subject and atmosphere of the reference image, and redraw it into a more premium advertising poster",
  "n": 1,
  "size": "2560x1440",
  "image": [
    "BASE64_IMAGE_1",
    "https://example.com/reference-2.png"
  ]
}

Response Example

{
  "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"
    }
  ]
}

Authentication

Authorization: Bearer YOUR_API_KEY

Body

model
string
required
The Doubao Seedream model name. Common values include doubao-seedream-4-0-250828, doubao-seedream-4-5-251128, and doubao-seedream-5-0-260128.
prompt
string
required
Generation prompt. It is recommended to pass this explicitly for both text-to-image and image-to-image.
n
integer
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.
size
string
Output size, passed directly as width and height pixel values. These Doubao models are typically mapped to fixed pixel sizes based on fixed ratios.
image
array<string> | string
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.
response_format
string
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
string
Quality field. The unified image DTO supports accepting it, but whether Doubao actually consumes this field depends on the final upstream service.
style
string | object
Style field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.
background
string | object
Background control field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.
watermark
boolean
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’s DOUBAO_SIZE_MAP, so you can use the table below:
Aspect Ratiosize Value
1:12048x2048
4:32304x1728
3:41728x2304
16:92560x1440
9:161440x2560
3:22496x1664
2:31664x2496
21:93024x1296
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

ScenarioKey FieldsDescription
Text-to-imageprompt + sizeThe most basic usage
Image-to-imageprompt + size + imageimage can contain one or more reference images

Response

created
integer
Generation timestamp.
data[].url
string
Returned image URL. When the current plugin encounters this field, it will download the image locally again.
data[].b64_json
string
Returned image Base64 data. The current plugin will preferentially use this field.
data[].revised_prompt
string
Some upstream services return an adjusted prompt.