Doubao Seedream

Doubao Seedream Image Generation API

Use `POST /v1/images/generations` to call the Doubao Seedream series image generation endpoint.

POSThttps://zx1.deepwl.net/v1/images/generations
Request
curl -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"
}'
Response
{
  "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 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

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.

ninteger

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.

sizestring

Output 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> | 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_formatstring

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.

qualitystring

Quality field. The unified image DTO supports accepting it, but whether Doubao actually consumes this field depends on the final upstream service.

stylestring | object

Style field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.

backgroundstring | object

Background control field. The unified image DTO supports accepting it; whether it takes effect depends on the specific Doubao channel.

watermarkboolean

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

Request Examples

Response Examples

Response Fields

createdinteger

Generation timestamp.

dataarray<object>

Array of generation results.

urlstring

Returned image URL. When the current plugin encounters this field, it will download the image locally again.

b64_jsonstring

Returned image Base64 data. The current plugin will preferentially use this field.

revised_promptstring

Some upstream services return an adjusted prompt.