Seedream 4.5 DreamCore API

开发者文档

通过这些端点异步生成 Seedream 4.5 作品。不同模型与质量会消耗不同的积分。

身份认证

所有请求必须在 Authorization header:

Authorization: Bearer <YOUR_API_KEY>

若缺失或无效则返回 401 Unauthorized.

POST

https://seedream45ai.org/api/generate

创建生成任务

提交一条 Seedream 4.5 任务,接口会立即返回 task_id,渲染在后台完成。

参数类型必填说明
promptstring (max 1500 chars)主要文字描述(最多 1500 字符),必填。
aspectRatiostring支持 1:1、3:4、4:3、9:16、16:9。
qualitystring (basic | high)basic(快速 2K)或 high(更清晰 4K)。
imageUrlsstring[]可选参考图,使用 edit 模式时必填。

积分扣除

任务被接受时立即扣积分;若失败系统会自动原路退还。

预设扣除积分
文字转图 · Basic12
文字转图 · High18
参考图编辑 · Basic18
参考图编辑 · High24
单次 4 张批量48
请求示例
POST https://seedream45ai.org/api/generate
Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json

{
  "prompt": "Cinematic photo of an obsidian smartwatch on a marble plinth, volumetric lighting",
  "aspectRatio": "4:3",
  "quality": "high",
  "imageUrls": []
}
响应示例
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "sd45_b83bf7c0c51a4c71"
  }
}
GET / POST

https://seedream45ai.org/api/status

查询任务状态

轮询该端点即可获得最新记录。若状态仍为 IN_PROGRESS,我们会先向上游再同步一次。

参数类型必填说明
task_idstring来自 /generate 的 ID,调用 /status 时通过查询参数传入。
字段说明
task_id/generate 返回的任务 ID。
statusIN_PROGRESS
request已清洗的请求内容快照。
response当状态为 SUCCESS 时返回的图片链接数组。
consumed_credits任务实际消耗的积分(退款后为 0)。
error_message当状态为 FAILED 时返回的错误信息。
created_at任务入队列时的 UTC 时间。
请求示例
GET https://seedream45ai.org/api/status?task_id=sd45_b83bf7c0c51a4c71
Authorization: Bearer <YOUR_API_KEY>
响应示例
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "sd45_b83bf7c0c51a4c71",
    "status": "SUCCESS",
    "request": {
      "prompt": "Cinematic photo of an obsidian smartwatch on a marble plinth, volumetric lighting",
      "aspectRatio": "4:3",
      "quality": "high"
    },
    "response": [
      "https://watch_001.png"
    ],
    "consumed_credits": 12,
    "error_message": null,
    "created_at": "2025-06-14T05:21:11Z"
  }
}

错误处理

  • 401 Unauthorized - API Key 缺失或无效。
  • 402 Payment Required - 积分余额不足以覆盖本次扣费。
  • 429 Too Many Requests - 请降低轮询或请求频率。
  • 500 - 上游暂时异常,请稍后重试并采用指数退避。