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

POST /v1/images/edits

Edit a reference image with a prompt using JSON or file upload.

Reference image editing

Required parameters: model, prompt, image

Available parameters: model, prompt, image, images, image_url, n, response_format, stream, size, sequential_image_generation, sequential_image_generation_options

Request parameters

ParameterTypeRequiredDescription
modelstringYesRequired. Use the exact model name seedream-4-0-250828.
promptstringYesEditing instruction, 1–32000 characters. Describe the requested changes.
imagestring | object | arrayYesRequired reference image. Accepts an HTTPS URL, an image data URL, an object with url or image_url, or an array of these values. Use 1–14 images and exactly one of image, images or image_url.
imagesarrayNoOptional alias of image. Elements are image URLs, data URLs, or objects with url/image_url. Do not combine with image.
image_urlstring | object | arrayNoOptional alias of image. Do not combine with image or images.
nintegerNoOptional positive integer, default 1. Multiple outputs must be supported by the selected model.
response_formatstringNoOptional: url or b64_json. Support and returned format depend on the model.
streambooleanNoOmit or set to false; this editing endpoint does not provide streaming.
sizestring | objectNoOptional returned image size.
sequential_image_generationstringNoOptional: auto or disabled. Explicit disabled cannot be combined with n>1.
sequential_image_generation_optionsobjectNoOptional sequential-generation settings; active only with auto.
Read url or b64_json from each data item. Fewer images than the requested limit may be returned; inspect every item. On failure read error instead of treating it as image output. Save generated images promptly because URLs may expire. This page describes the platform editing endpoint; the model vendor’s native request format may differ. Reviewed on 2026-11-27.

Request example

curl https://api.router.ai/v1/images/edits \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "seedream-4-0-250828",
  "prompt": "将示例陶瓷杯改为蓝色,保留背景。",
  "image": "https://example.invalid/reference.png",
  "n": 1
}'

Endpoint reference: OpenAI GPT Image editing (i2i)