返回模型列表

Doubao Seedream 4.5

doubaodoubao/doubao-seedream-4-5

Doubao SeedDream 4.5 — text/image-to-image generation, Chinese-bilingual prompt support.

上下文长度
--
最大输出
--
请求价格按次
$0.0416每次请求

模态能力

文本图像图像

价格明细

类型费率
请求$0.0416 每次请求

Per-image flat fee (cost-mirrored from Ark at launch)

支持参数

promptsizenresponse_formatuser

API 使用示例

所有新集成都应使用下方示例中的全球端点 api.therouter.ai;旧中国加速端点已下线。

建议使用异步 API

图像生成通常需要 30–180 秒,超过同步请求的边缘超时。下方示例已使用 ?async=true + 轮询模式。 查看异步图像生成 / 编辑完整指南 →

cURL
# 1) Submit job (returns 202 immediately with a polling URL).
# Image generation takes 30-180s — always use the async path in production.
JOB=$(curl -s -X POST "https://api.therouter.ai/v1/images/generations?async=true"   -H "Content-Type: application/json"   -H "Authorization: Bearer $THE_ROUTER_API_KEY"   -d '{
    "model": "doubao/doubao-seedream-4-5",
    "prompt": "A cinematic product render with soft studio lighting"
  }' | python3 -c "import sys,json;print(json.load(sys.stdin)['id'])")
echo "submitted: $JOB"

# 2) Poll until terminal (succeeded / failed / cancelled / expired).
while :; do
  R=$(curl -s "https://api.therouter.ai/v1/jobs/$JOB"     -H "Authorization: Bearer $THE_ROUTER_API_KEY")
  S=$(echo "$R" | python3 -c "import sys,json;print(json.load(sys.stdin)['status'])")
  echo "status: $S"
  case "$S" in
    succeeded) echo "$R" | python3 -c "import sys,json;print(json.load(sys.stdin)['unsigned_urls'][0])"; break ;;
    failed|cancelled|expired) echo "$R"; exit 1 ;;
  esac
  sleep 5
done

图像编辑示例

上传一张图片并用文本 prompt 描述编辑要求;模型会返回编辑后的图片(base64)。

cURL
# Same async submit + poll pattern as /v1/images/generations.
JOB=$(curl -s -X POST "https://api.therouter.ai/v1/images/edits?async=true"   -H "Authorization: Bearer $THE_ROUTER_API_KEY"   -F "model=doubao/doubao-seedream-4-5"   -F "prompt=Turn this scene into a watercolor painting"   -F "size=1024x1024"   -F "image=@input.png" | python3 -c "import sys,json;print(json.load(sys.stdin)['id'])")
echo "submitted: $JOB"

while :; do
  R=$(curl -s "https://api.therouter.ai/v1/jobs/$JOB"     -H "Authorization: Bearer $THE_ROUTER_API_KEY")
  S=$(echo "$R" | python3 -c "import sys,json;print(json.load(sys.stdin)['status'])")
  echo "status: $S"
  case "$S" in
    succeeded) echo "$R" | python3 -c "import sys,json;print(json.load(sys.stdin)['unsigned_urls'][0])"; break ;;
    failed|cancelled|expired) echo "$R"; exit 1 ;;
  esac
  sleep 5
done
客服支持