Skip to main content
POST
https://toapis.com
/
v1
/
images
/
generations
curl --request POST \
  --url https://toapis.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-4-5",
    "prompt": "A cute panda playing in a bamboo forest",
    "size": "1:1",
    "resolution": "2K",
    "n": 1
  }'
{
  "id": "task_img_abc123def456",
  "object": "generation.task",
  "model": "doubao-seedance-4-5",
  "status": "queued",
  "progress": 0,
  "created_at": 1703884800,
  "metadata": {}
}
  • Seedream 4.5 latest high-quality image generation model
  • Use model parameter to select doubao-seedance-4-5 model
  • Supports text-to-image generation with superior quality
  • Async task management, query results by task ID

Authorizations

Authorization
string
required
All endpoints require Bearer Token authenticationGet your API Key from the API Key Management PageAdd to request header:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"doubao-seedance-4-5"
required
Image generation model nameExample: "doubao-seedance-4-5"
prompt
string
required
Text description for image generation
size
string
default:"1:1"
Image aspect ratioSupported aspect ratios:
  • 1:1 - Square (default)
  • 4:3 - Landscape 4:3
  • 3:4 - Portrait 3:4
  • 16:9 - Landscape widescreen
  • 9:16 - Portrait vertical
  • 3:2 - Landscape 3:2
  • 2:3 - Portrait 2:3
  • 21:9 - Ultra-wide
  • 9:21 - Ultra-tall
resolution
string
default:"2K"
Image resolutionSupported resolutions:
  • 2K - Standard resolution (default)
  • 4K - High definition
Note: Seedream-4.5 does not support 1K resolution
Resolution reference sizes:
Resolution1:1 Size16:9 Size
2K2048x20482560x1440
4K4096x40965404x3040
n
integer
default:1
Number of images to generateRange: 1-15 (minimum 1, maximum 15)Default: 1Note:
  • The actual number of images that can be generated is affected by both this parameter and the number of input reference images. The total of reference images + generated images must be ≤ 15
  • Must enter a plain number (e.g., 1), do not use quotes or it will cause an error
Charges will be pre-deducted based on the number
image_urls
array
Reference image URL list for image-to-image or image editing
  • Maximum 10 images
  • Image formats: jpeg, png
  • Aspect ratio (width/height) range: [1/3, 3]
  • Width and height (px) > 14
  • Size: not exceeding 10MB
  • Total pixels: not exceeding 6000×6000 px
optimize_prompt_options.mode
string
default:"standard"
Prompt optimization mode
  • standard: Standard mode, generates higher quality content with longer processing time
  • fast: Fast mode, generates content in shorter time with regular quality
Default: standard
sequential_image_generation
string
default:"disabled"
Sequential image generation mode (Doubao-specific feature)Controls whether to generate multiple images:
  • disabled: Disable sequential mode, generates only 1 image even with multiple reference images (default)
  • auto: Enable sequential mode, can generate multiple images
Usage Notes:
  • ✅ Must provide image_urls - at least 1 reference image required
  • ✅ Set n: 3 or use sequential_image_generation: "auto" + max_images: 3
  • ✅ This will generate 3 different images based on reference images
  • ⚠️ When n > 1, it will automatically be set to auto
Limitations:
  • Pure text-to-image (without image_urls) cannot generate multiple images - this is a Doubao API limitation
sequential_image_generation_options
object
Sequential image generation optionsAvailable when sequential_image_generation is set to autoProperties:
  • max_images (integer): Specify the number of images to generate, Range: 1-15
Example:
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
  "max_images": 3
}
watermark
boolean
default:false
Whether to add a watermark to the generated image
  • true: Add watermark
  • false: No watermark (default)

Response

id
string
Unique task identifier for status queries
object
string
Object type, always generation.task
model
string
Model name used
status
string
Task status
  • queued - Queued for processing
  • in_progress - Processing
  • completed - Successfully completed
  • failed - Failed
progress
integer
Task progress percentage (0-100)
created_at
integer
Task creation timestamp (Unix timestamp)
metadata
object
Task metadata
curl --request POST \
  --url https://toapis.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "doubao-seedance-4-5",
    "prompt": "A cute panda playing in a bamboo forest",
    "size": "1:1",
    "resolution": "2K",
    "n": 1
  }'
{
  "id": "task_img_abc123def456",
  "object": "generation.task",
  "model": "doubao-seedance-4-5",
  "status": "queued",
  "progress": 0,
  "created_at": 1703884800,
  "metadata": {}
}