Seedream 4.0 API

Supports text-to-image and image-to-image generation with up to three reference images.

POST /v1/images/generations

Text-to-image generation.

Request parameters

ParameterTypeRequiredDescription
modelstringYesImage model ID, e.g. `imagen-4.0-fast` / `imagen-4.0-standard` / `imagen-4.0-ultra` / `imagen-3.0-generate-002`
promptstringYesText description, supports both Chinese and English
nintegerNoNumber of generated images
sizestringNoImage size Options: 1024x1024 / 1792x1024 / 1024x1792 / 1536x1536
qualitystringNoQuality level (supported by some models) Options: standard / hd
response_formatstringNo Options: url / b64_json

Request example

curl https://api.router.ai/v1/images/generations \
  -H "Authorization: Bearer sk-你的令牌" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-4-0-250828",
    "prompt": "雪山日出,长焦压缩,胶片颗粒",
    "size": "1024x1024"
  }'

Endpoint reference: Aliyun Qwen-Image text-to-image