gpt-image-2.6-sunburst-call

使用前按接入基础设置 SHANHAI_BASE_URL(本站根地址)和 SHANHAI_API_KEY(本站令牌)。下方命令适用于 Bash;素材示例地址须替换为可直接下载的真实地址。

文字生成使用 JSON,参考图使用文件上传。

POST /v1/images/generations · POST /v1/images/edits

请求参数

参数 取值
model gpt-image-2.6-sunburst-call / gpt-image-2.6-sunburst-按次
n 1
size (PNG) 1024x1024, 1536x1024, 1024x1536
image (edits) PNG / JPEG / WebP / GIF · multipart/form-data
response_format b64_json
output_format png / gif
frame_count (edits) 2–64 (4)
frame_duration_ms (edits) 20–2000 ms (200 ms), Δ 10 ms

纯文字 GIF 为 4 帧,每帧 200 毫秒。添加参考图后可以调整帧数和每帧时长。

请求示例

curl --fail-with-body "$SHANHAI_BASE_URL/v1/images/generations" \
  -H "Authorization: Bearer $SHANHAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-image-2.6-sunburst-call",
  "prompt": "A red ball rolling from left to right",
  "n": 1,
  "response_format": "b64_json",
  "output_format": "gif"
}'

图生图

curl --fail-with-body "$SHANHAI_BASE_URL/v1/images/edits" \
  -H "Authorization: Bearer $SHANHAI_API_KEY" \
  -F "model=gpt-image-2.6-sunburst-call" -F "n=1" -F "response_format=b64_json" \
  -F "prompt=Change only the red ball to green" \
  -F "size=1024x1024" -F "image=@reference.png;type=image/png"
curl --fail-with-body "$SHANHAI_BASE_URL/v1/images/edits" \
  -H "Authorization: Bearer $SHANHAI_API_KEY" \
  -F "model=gpt-image-2.6-sunburst-call" -F "n=1" -F "response_format=b64_json" \
  -F "prompt=Animate only the red ball" -F "image=@reference.png;type=image/png" \
  -F "output_format=gif" -F "frame_count=5" -F "frame_duration_ms=300"

返回结果

解码 data[0].b64_json,然后按实际格式保存文件。

遇到问题

调用或配置遇到问题,请联系站内客服,提供模型名、任务编号、出错时间及错误信息,不要提供完整令牌。