POST
/
v1
/
images
/
generations
curl --request POST \
  --url https://vip.xmsmartlink.com/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "doubao-seedream-5-0-260128",
  "prompt": "将图1的服装换为图2的服装",
  "size": "2K",
  "output_format": "png",
  "response_format": "url",
  "image": [
    "https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/4b4464161cf3463db6f9463b10939178~tplv-goo7wpa0wc-image.image",
    "https://p9-arcosite.byteimg.com/tos-cn-i-goo7wpa0wc/c23d1b0528a14cb08b684307eabdcc9b~tplv-goo7wpa0wc-image.image"
  ],
  "sequential_image_generation": "auto",
  "sequential_image_generation_options": {
    "max_images": 3
  },
  "watermark": false
}
'
{
  "created": 1776164935,
  "model": "doubao-seedream-5-0-260128",
  "data": [
    {
      "url": "https://example",
      "size": "2k"
    }
  ],
  "usage": {
    "generated_images": 1,
    "output_tokens": 17800,
    "total_tokens": 17800
  }
}

Authorizations

Authorization
string
header
required

使用 Authorization: Bearer <YOUR_API_KEY> 进行认证。

Body

application/json
model
string
required

图片模型名称,例如 doubao-seedream-5-0-260128、wan2.7-image、wan2.7-image-pro、gpt-image-1.5 或 gpt-image-2。

prompt
string
required

图片提示词或图片描述。

image

输入图片 URL 或 Base64。Seedream 支持传入字符串或字符串数组,用于参考图、编辑、融合等场景。

n
integer

生成数量,默认为 1。

Required range: x >= 1
size
string

输出尺寸。Seedream 支持 2K/3K/pixel sizes;Qwen 支持 1K/2K/4K;GPT-Image 支持 1024x1024、1024x1536、1536x1024、auto,以及 gpt-image-2 的自定义尺寸。

response_format
enum<string>

响应图片格式,可选 url 或 b64_json。GPT-Image 仅支持 b64_json。

Available options:
url,
b64_json
output_format
enum<string>

输出图片编码格式,可选 png 或 jpeg,具体取决于模型支持情况。

Available options:
png,
jpeg
output_compression
integer

JPEG 压缩质量,范围 0-100;仅在 output_format=jpeg 时生效。

Required range: 0 <= x <= 100
quality
enum<string>

GPT-Image 图片质量设置。

Available options:
auto,
high,
medium,
low
background
enum<string>

GPT-Image 背景设置。

Available options:
auto,
transparent,
opaque
enable_sequential
boolean

Qwen-Image 组图生成开关。

thinking_mode
boolean

Qwen-Image 推理模式开关。

watermark
boolean

是否添加水印。

sequential_image_generation
enum<string>

Seedream 组图生成模式;本项目接受 auto 或 disabled。

Available options:
auto,
disabled
sequential_image_generation_options
object

Response

图片生成响应。响应结构兼容 OpenAI;模型支持时会包含提供商特有 metadata。

created
integer<int64>
model
string
data
object[]
background
string
output_format
string
quality
string
size
string
usage
object

图片生成用量统计。

metadata
object

上游返回的元数据信息。