GPT 图片
gpt-image-2——写实、贴合提示词的文生图与图片编辑
gpt-image-2 是默认图片模型:写实能力强、贴合提示词,传 image_urls 时还擅长编辑已有图片。
异步任务,提交后轮询查状态。
接口:
POST /api/v2/image/generate| 鉴权:Authorization: Bearer sk_...
请求
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
prompt | string | ✅ | 文本提示词 |
model | string | ⬜ | gpt-image-2(默认) |
size | string | ⬜ | 1:1(默认)/ 16:9 / 9:16 |
image_urls | string[] | ⬜ | 图生图 / 编辑的参考图,最多 4 张 |
seed | int | ⬜ | 随机种子 |
curl -X POST https://api.aiclonevoicefree.com/api/v2/image/generate \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "一只柴犬在樱花树下,电影感打光",
"model": "gpt-image-2",
"size": "16:9"
}'编辑 / 图生图——传最多 4 张参考图:
curl -X POST https://api.aiclonevoicefree.com/api/v2/image/generate \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "给狗戴上圣诞帽",
"model": "gpt-image-2",
"image_urls": ["https://example.com/dog.png"]
}'响应 202
{ "task_id": "xxxxxxxx", "status": "pending", "capability": "image", "action": "generate", "model": "gpt-image-2" }取结果
轮询 GET /api/v2/tasks/{task_id},完成时:
{
"status": "completed",
"capability": "image",
"_type": "image.generate",
"imageUrl": "https://.../result.png"
}计费
每张固定 3 视频积分——与 size、是否带参考图无关,n 固定为 1。
算例:生成 1 张图(任意尺寸、带不带 image_urls)= 3 积分。
完成结算、失败自动退款(见通用约定)。用的是视频积分。