Seedream 4.0 API

基礎文生圖 / 圖生圖, 支援最多 3 張參考圖

POST /v1/images/generations

文生圖。

請求參數

參數類型必填說明
modelstring是影像模型 ID, 如 `imagen-4.0-fast` / `imagen-4.0-standard` / `imagen-4.0-ultra` / `imagen-3.0-generate-002`
promptstring是文本描述, 支援中英文
ninteger否生成圖片數量
sizestring否影像尺寸 可選: 1024x1024 / 1792x1024 / 1024x1792 / 1536x1536
qualitystring否品質檔位 (部分模型支援) 可選: standard / hd
response_formatstring否 可選: url / b64_json

請求示例

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"
  }'

介面通用說明: Aliyun Qwen-Image 文生圖

POST /v1/images/edits

使用參考圖和編輯指令生成修改後的圖片;支援 JSON 或檔案上傳。

參考圖編輯

必填參數: model, prompt, image

可用參數: model, prompt, image, images, image_url, n, response_format, stream, size, sequential_image_generation, sequential_image_generation_options

請求參數

參數類型必填說明
modelstring是必填,精確使用 seedream-4-0-250828。
promptstring是編輯指令,1~32000 字元;請直接說明需要修改的內容。
imagestring | object | array是必填參考圖。可用 HTTPS 地址、圖片 data URL、{"url":"..."}、{"image_url":"..."} 或上述元素陣列。1~14 張;與 images、image_url 三選一。
imagesarray否image 的可選別名;元素為地址、圖片 data URL 或含 url/image_url 的物件。不能同時傳 image。
image_urlstring | object | array否image 的可選別名;不能與 image、images 同時傳入。
ninteger否可選,預設 1,必須為正整數。多圖數量須在本型號支援範圍內。
response_formatstring否可選,url 或 b64_json。具體支援和返回形式以本型號為準。
streamboolean否僅支援省略或 false;本編輯入口不提供流式響應。
sizestring | object否可選輸出尺寸。沿用本型號圖片生成介面的格式及檔位;此處不擴充套件型號支援範圍。
sequential_image_generationstring否可選,auto 或 disabled;顯式 disabled 不能與 n>1 同用。
sequential_image_generation_optionsobject否可選順序多圖設定;啟用 auto 後生效。
讀取 data 陣列中的 url 或 b64_json。返回張數可能少於請求上限,請逐項檢查。出現錯誤時讀取 error,不要把錯誤物件當成圖片結果。輸出連結可能過期,應及時儲存。 本頁描述平臺編輯入口;廠商原生端點的請求格式可能不同。核對日期:2026-11-27。

請求示例

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
}'

介面通用說明: OpenAI GPT Image 圖生圖 (i2i)