gpt-image-2.5-sunburst
最后更新:2026-11-14
POSThttps://www.sagelib.com/images/edits
gpt-image-2.5-sunburst 模型的图像编辑接口,OpenAI兼容,基于原图+文本指令对图像进行局部或整体修改。
接口鉴权方式请参考:API接入与鉴权
请求参数
请求头
| 参数名称 | 描述 |
|---|---|
*Authorization string |
鉴权令牌,格式为 Bearer ${AIGATEWAY_TOKEN} |
*Content-Type string |
可选值:multipart/form-data multipart/form-data; boundary=${boundary},boundary由请求工具自动生成 |
Body 参数
| 参数名称 | 描述 |
|---|---|
*prompt string |
可选值:- (up to 32000 characters) 图像生成的文本描述提示词,描述期望的图像内容与风格 |
model string |
默认值:gpt-image-2.5-sunburst 可选值:gpt-image-2.5-flare / gpt-image-2.5-sunburst 模型名称,取值 gpt-image-2.5-flare / gpt-image-2.5-sunburst |
n integer |
默认值:1 可选值:1-10 一次请求生成的图像数量,响应 data 数组长度与之一致 |
size string |
默认值:1024x1024 可选值:auto / 1024x1024 / 1536x1024 / 1024x1536 (+ custom WxH) 输出图像分辨率,支持枚举档位与自定义 WxH 像素 |
quality string |
默认值:auto 可选值:auto / low / medium / high / xhigh / max 图像质量档位 |
background string |
默认值:auto 可选值:transparent / opaque / auto 背景处理方式,transparent 生成透明背景(png/webp 下生效) |
output_format string |
默认值:png 可选值:png / jpeg / webp 输出图像编码格式,transparent 背景须配 png 或 webp |
output_compression integer |
默认值:100 可选值:0-100 有损压缩率百分比,仅 jpeg/webp 生效 |
partial_images integer |
默认值:0 可选值:0-3 流式模式下返回的中间预览图数量,须配合 stream=true 使用 |
stream boolean |
默认值:false 可选值:true、false 是否流式返回,true 时以 SSE 事件流逐帧返回图像数据 |
user string |
终端用户标识符,用于滥用追踪,不影响生成内容 |
*image string |
可选值:Image file or URL 待编辑的原始图像,form-data 文件或图像 URL 形式 |
mask string |
可选值:Image file or URL 编辑掩码图像,透明区域指示可编辑范围 |
请求示例
curl -v 'https://${base_url}/v2/llm/images/edits' \
-H "Authorization: Bearer ***" \
-F "image=${image_url}" \
-F "model=gpt-image-2.5-sunburst" \
-F "prompt=Replace the background with a starry night sky, keeping the cat's posture and fur color unchanged, photorealistic style, with the Milky Way clearly visible" \
-F "size=1024x1024"
curl -v 'https://${base_url}/v2/llm/images/edits' \
-H "Authorization: Bearer ***" \
-F "image=${image_url}" \
-F "model=gpt-image-2.5-sunburst" \
-F "n=2" \
-F "prompt=Replace the background with a starry night sky, keeping the cat's posture and fur color unchanged, photorealistic style, with the Milky Way clearly visible" \
-F "size=1024x1024"
curl -v 'https://${base_url}/v2/llm/images/edits' \
-H "Authorization: Bearer ***" \
-F "background=transparent" \
-F "image=${image_url}" \
-F "model=gpt-image-2.5-sunburst" \
-F "output_format=png" \
-F "prompt=Replace the background with a starry night sky, keeping the cat's posture and fur color unchanged, photorealistic style, with the Milky Way clearly visible" \
-F "size=1024x1024"
响应参数
Body 参数
| 参数名称 | 描述 |
|---|---|
created integer |
生成时间戳(Unix 秒) |
data array |
图像数组,长度 = n |
b64_json string |
Base64 编码的图像数据(本模型系列不返回 url 字段) |
usage object |
Token 使用统计 |
input_tokens integer |
输入 token 数(input_tokens_details 含 image_tokens/text_tokens 细分) |
output_tokens integer |
输出 token 数(output_tokens_details 含 image_tokens 细分) |
total_tokens integer |
总 token 数 |
size string |
实际输出尺寸 |
quality string |
实际质量档位 |
background string |
实际背景处理方式 |
output_format string |
实际输出格式 |
model string |
实际使用的模型名 |
POSThttps://www.sagelib.com/openai/images/edits
gpt-image-2.5-sunburst 模型的图像编辑接口,OpenAI直连模式(URL 前缀 /openai),基于原图+文本指令编辑图像。
接口鉴权方式请参考:API接入与鉴权
请求参数
请求头
| 参数名称 | 描述 |
|---|---|
*Authorization string |
鉴权令牌,格式为 Bearer ${AIGATEWAY_TOKEN} |
*Content-Type string |
可选值:multipart/form-data multipart/form-data; boundary=${boundary},boundary由请求工具自动生成 |
Body 参数
| 参数名称 | 描述 |
|---|---|
*prompt string |
可选值:- (up to 32000 characters) 图像生成的文本描述提示词,描述期望的图像内容与风格 |
model string |
默认值:gpt-image-2.5-sunburst 可选值:gpt-image-2.5-flare / gpt-image-2.5-sunburst 模型名称,取值 gpt-image-2.5-flare / gpt-image-2.5-sunburst |
n integer |
默认值:1 可选值:1-10 一次请求生成的图像数量,响应 data 数组长度与之一致 |
size string |
默认值:1024x1024 可选值:auto / 1024x1024 / 1536x1024 / 1024x1536 (+ custom WxH) 输出图像分辨率,支持枚举档位与自定义 WxH 像素 |
quality string |
默认值:auto 可选值:auto / low / medium / high / xhigh / max 图像质量档位 |
background string |
默认值:auto 可选值:transparent / opaque / auto 背景处理方式,transparent 生成透明背景(png/webp 下生效) |
output_format string |
默认值:png 可选值:png / jpeg / webp 输出图像编码格式,transparent 背景须配 png 或 webp |
output_compression integer |
默认值:100 可选值:0-100 有损压缩率百分比,仅 jpeg/webp 生效 |
partial_images integer |
默认值:0 可选值:0-3 流式模式下返回的中间预览图数量,须配合 stream=true 使用 |
stream boolean |
默认值:false 可选值:true、false 是否流式返回,true 时以 SSE 事件流逐帧返回图像数据 |
user string |
终端用户标识符,用于滥用追踪,不影响生成内容 |
*image string |
可选值:Image file or URL 待编辑的原始图像,form-data 文件或图像 URL 形式 |
mask string |
可选值:Image file or URL 编辑掩码图像,透明区域指示可编辑范围 |
请求示例
curl -v 'https://${base_url}/v2/llm/openai/images/edits' \
-H "Authorization: Bearer ***" \
-F "image=${image_url}" \
-F "model=gpt-image-2.5-sunburst" \
-F "prompt=Replace the background with a starry night sky, keeping the cat's posture and fur color unchanged, photorealistic style, with the Milky Way clearly visible" \
-F "size=1024x1024"
curl -v 'https://${base_url}/v2/llm/openai/images/edits' \
-H "Authorization: Bearer ***" \
-F "image=${image_url}" \
-F "model=gpt-image-2.5-sunburst" \
-F "n=2" \
-F "prompt=Replace the background with a starry night sky, keeping the cat's posture and fur color unchanged, photorealistic style, with the Milky Way clearly visible" \
-F "size=1024x1024"
curl -v 'https://${base_url}/v2/llm/openai/images/edits' \
-H "Authorization: Bearer ***" \
-F "background=transparent" \
-F "image=${image_url}" \
-F "model=gpt-image-2.5-sunburst" \
-F "output_format=png" \
-F "prompt=Replace the background with a starry night sky, keeping the cat's posture and fur color unchanged, photorealistic style, with the Milky Way clearly visible" \
-F "size=1024x1024"
响应参数
Body 参数
| 参数名称 | 描述 |
|---|---|
created integer |
生成时间戳(Unix 秒) |
data array |
图像数组,长度 = n |
b64_json string |
Base64 编码的图像数据(本模型系列不返回 url 字段) |
generation_id string |
本次生成的标识 ID |
usage object |
Token 使用统计 |
input_tokens integer |
输入 token 数(input_tokens_details 含 image_tokens/text_tokens 细分) |
output_tokens integer |
输出 token 数(output_tokens_details 含 image_tokens 细分) |
total_tokens integer |
总 token 数 |
size string |
实际输出尺寸 |
quality string |
实际质量档位 |
background string |
实际背景处理方式 |
output_format string |
实际输出格式 |