POST
/
v1
/
images
/
generations
生成/编辑图像
curl --request POST \
  --url https://api.example.com/v1/images/generations/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "doubao-seedream-5-0-260128",
  "prompt": "充满活力的特写编辑肖像,模特眼神犀利,头戴雕塑感帽子,色彩拼接丰富,眼部焦点锐利,景深较浅,具有Vogue杂志封面的美学风格,采用中画幅拍摄,工作室灯光效果强烈。",
  "size": "2K",
  "output_format": "png",
  "watermark": false
}
'
{
  "model": "doubao-seedream-5-0-260128",
  "created": 1757321139,
  "data": [
    {
      "url": "https://...",
      "size": "3104x1312"
    }
  ],
  "usage": {
    "generated_images": 1,
    "output_tokens": 2,
    "total_tokens": 3
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

所需图像的文本描述。

output_format
string
required

选值:png jpeg

response_format
string
required

url:返回图片下载链接;链接在图片生成后24小时内有效,请及时下载图片。 b64_json:以 Base64 编码字符串的 JSON 格式返回图像数据。

stream
string
required
extra_body
object
required
model
string

用于图像生成的模型。

size
string

方式 1:1K 2K 3K 4K 方式 2: 1280x720 2560x1440 3072x3072x1.1025 4096x4096

Response

200 - application/json
created
integer
required
data
object[]
required
usage
object
required