Multi-Image Generation (doubao-seedream-4-5)

Given a prompt, the model will generate multiple sequential images. Related guide: Image Generation

Endpoint

POST /v1/images/generations

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Request Parameters

ParameterTypeRequiredDescription
modelstringYesThe ID of the model to use, e.g., doubao-seedream-4-5-251128
promptstringYesText prompt for generating images, supports both Chinese and English
sizestringNoImage size specification. Method 1: Resolution options 1K, 2K, 4K. Method 2: Width x Height pixels (default: 2048x2048). Area range: [1024x1024, 4096x4096], aspect ratio range: [1/16, 16]
sequential_image_generationstringNoControls multi-image generation. auto: Model automatically determines whether to return multiple images based on prompt. disabled: Only generates one image. Default: disabled
sequential_image_generation_optionsobjectNoOptions for sequential image generation, including max_images to set maximum number of images
streambooleanNoEnable streaming output mode. Default: false
response_formatstringNoOutput format. url: Returns downloadable jpeg image links (valid for 24 hours). b64_json: Returns Base64 encoded JSON. Default: url
watermarkbooleanNoWhether to add watermark. true: Adds “AI Generated” watermark at bottom right. false: No watermark. Default: true

Request Example

curl -X POST "https://api.example.com/v1/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-4-5-251128",
    "prompt": "Generate a set of 4 coherent illustrations showing the four seasons of the same courtyard corner",
    "size": "2K",
    "sequential_image_generation": "auto",
    "sequential_image_generation_options": {
      "max_images": 4
    },
    "stream": false,
    "response_format": "url",
    "watermark": false
  }'

Response Example

{
  "data": [
    {
      "url": "https://example.com/generated-image-1.jpeg"
    },
    {
      "url": "https://example.com/generated-image-2.jpeg"
    },
    {
      "url": "https://example.com/generated-image-3.jpeg"
    },
    {
      "url": "https://example.com/generated-image-4.jpeg"
    }
  ],
  "created": 1757469067,
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 15908,
    "prompt_tokens_details": {
      "cached_tokens_details": {}
    },
    "completion_tokens_details": {},
    "output_tokens": 15908
  }
}