POST
gpt-image-2-all
POST /v1/images/generations
gpt-image-2-all
零度 API 提供的兼容图片生成模型,支持文生图与图生图调用。
官方参考文档: https://platform.openai.com/docs/api-reference/images/create
接口信息
| HTTP 方法 | POST |
| 接口路径 | /v1/images/generations |
| 完整地址 | https://api000.com/v1/images/generations |
| 认证方式 | Bearer Token |
请求头
| Header 参数 | 必填 | 示例 |
|---|---|---|
Content-Type |
是 | application/json |
Authorization |
是 | Bearer sk-xxxxxxxxxxxxxxxx |
Accept |
否 | application/json |
Authorization必须填写,格式为:Bearer 空格 API Key。例如:Bearer sk-xxxxxxxxxxxxxxxx。
文生图请求 JSON
{
"model": "gpt-image-2-all",
"prompt": "未来城市夜景,霓虹灯,赛博朋克风格,电影级画面",
"size": "1024x1024",
"n": 1,
"quality": "high"
}
图生图请求 JSON
{
"model": "gpt-image-2-all",
"prompt": "将两张图片中的主体自然合并在一起,保持主体外观清晰",
"image": [
"https://imageproxy.zhongzhuan.chat/api/proxy/image/c42f4361295d6d70e3228498855c5814.png",
"https://imageproxy.zhongzhuan.chat/api/proxy/image/5b718c199e90b1fbbe06e7db9d88ebab.jpg"
],
"size": "1024x1024",
"n": 1,
"quality": "high"
}
提示:
- 图生图时,
image数组中必须填写公网可访问的图片 URL。