Skip to main content
POST
/
v1
/
images
/
generations
curl -X POST https://gogogotoken.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-0-lite",
    "prompt": "a minimalist product photo of a smartwatch on white background, studio lighting",
    "n": 1
  }'
{
  "model": "seedream-5-0-260128",
  "created": 1782574755,
  "data": [
    {
      "url": "https://assets.example.com/generated-image.jpeg",
      "size": "2048x2048"
    }
  ],
  "usage": {
    "generated_images": 1,
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}
通过 OpenAI Images 兼容格式调用 Seedream 文生图模型。模型列表与 USD 单价见 Seedream 图像模型
curl -X POST https://gogogotoken.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-0-lite",
    "prompt": "a minimalist product photo of a smartwatch on white background, studio lighting",
    "n": 1
  }'
{
  "model": "seedream-5-0-260128",
  "created": 1782574755,
  "data": [
    {
      "url": "https://assets.example.com/generated-image.jpeg",
      "size": "2048x2048"
    }
  ],
  "usage": {
    "generated_images": 1,
    "output_tokens": 16384,
    "total_tokens": 16384
  }
}

接口说明

  • Base URLhttps://gogogotoken.ai
  • 路径POST /v1/images/generations
  • 鉴权Authorization: Bearer YOUR_API_KEY
  • Content-Typeapplication/json
响应中的 model 字段可能显示上游内部 ID(如 seedream-5-0-260128),调用时仍请使用 doubao-seedream-5-0-litedoubao-seedream-4-5
图片 URL 通常有时效(例如 24 小时)。请在拿到结果后尽快下载或转存到你的对象存储。

请求头

Authorization
string
required
API Key 鉴权信息,格式为 Bearer YOUR_API_KEY
Content-Type
string
required
固定为 application/json

请求体

model
string
default:"doubao-seedream-5-0-lite"
required
模型 ID:doubao-seedream-5-0-litedoubao-seedream-4-5。完整列表见 模型列表
prompt
string
required
图片描述,支持中英文。
n
integer
default:1
生成数量,默认 1。按实际成功输出张数计费。
size
string
可选。不传时默认 2048×2048。若指定,总像素须 ≥ 3,686,400(勿传 1024×1024)。
response_format
string
返回格式,例如 urlb64_json。Seedream 上游通常返回 url

响应体

created
integer
响应创建时间戳。
data
object[]
图片结果数组。
url
string
生成图片的可访问 URL。
size
string
实际输出尺寸,例如 2048x2048
b64_json
string
base64 编码的图片内容(若上游与 response_format 支持)。
usage.generated_images
integer
成功生成的图片张数,用于核对按张扣费。

错误码

状态码含义处理建议
400参数无效(如 size 过小)省略 size 或改用 ≥ 1920×1920
401API Key 无效或未传检查请求头与令牌状态
403无权限访问目标模型检查 API Key 分组权限
429触发限速降低请求频率或调整套餐
5xx上游或网关异常稍后重试,并查看控制台日志