GPT-Image 文生图

GPT-Image 文生图使用 OpenAI 兼容图片生成入口。该模型仅支持 Base64 图片返回。

Endpoint

POST /v1/images/generations

鉴权

Authorization: Bearer <YOUR_API_KEY>

参数说明

参数类型必填说明
modelstringgpt-image-1.5gpt-image-2
promptstring图片描述。
ninteger生成数量,默认为 1。
sizestring输出尺寸,例如 1024x1024、1024x1536、1536x1024、auto,或 gpt-image-2 支持的自定义尺寸。
qualitystringautohighmediumlow
backgroundstringautotransparentopaque。JPEG 不支持透明背景。
output_formatstringpngjpeg
output_compressionintegerJPEG 压缩质量,范围 0-100。
response_formatstring仅支持 b64_json

API Reference

查看底层接口定义