平台上最便宜的 GPT Image 2 通道,现已支持 1K/2K/4K 三档(medium 质量):1K $0.008、2K $0.015、4K $0.025。同一端点自动路由文生图 / 图生图(参考图 + 多图融合),同步返回,无需轮询。
Authorization: Bearer YOUR_API_KEY| 模型 | model | 价格 | 说明 |
|---|---|---|---|
| GPT Image 2 Lite | gpt-image-2-lite | 1K $0.008 · 2K $0.015 · 4K $0.025 /张 | 同步 · 1K/2K/4K(medium 质量)· 文生图 + 图生图 |
/api/v1/images/generations# ─── 1. Text-to-image ──────────────────────────────────────
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-lite",
"prompt": "A children'"'"'s book drawing of a veterinarian using a stethoscope to listen to the heartbeat of a baby otter.",
"aspect_ratio": "1:1",
"resolution": "2K"
}'
# Response (sync — image URL returned directly):
# { "code": 200, "msg": "success", "data": { "taskId": "clxxx", "state": "completed", "resultUrls": ["https://r2.apimodels.app/..."] } }
# ─── 2. Image editing with a reference URL ────────────────
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-lite",
"prompt": "Change the season to winter with snow",
"image_url": "https://example.com/landscape.jpg"
}'
# ─── 3. Multi-image fusion via base64 ─────────────────────
curl -X POST https://api.apimodels.app/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2-lite",
"prompt": "Combine the model from image 1 with the outfit from image 2",
"image_base64": "BASE64_IMAGE_1",
"image_urls": ["https://example.com/outfit.jpg"]
}'
# ─── 4. Poll status (lite is sync, this returns completed) ─
curl "https://api.apimodels.app/v1/images/generations?task_id=TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| model | 是 | string | 必须为 "gpt-image-2-lite" |
| prompt | 是 | string | 图片描述或编辑指令。多图编辑可用 "image 1"、"image 2" 引用具体参考图 |
| aspect_ratio | 否 | string | "auto"(默认)或 W:H 枚举,如 1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9。⚠️ auto 的真实行为:**图生图**跟随参考图比例;**文生图**没有可跟随的输入,会退回 1:1 方图——不是"让模型自决"。要指定形状请直接选枚举值。另外两点实测(2026-08-13):在提示词里写比例**无效**(不传 size 只在提示词里写 5:2,仍回 1024×1024);传枚举以外的精确 size 会被上游**吸附到最近的网格**(传 5:2 的 1600×640 与传 21:9 的 1552×656 拿回的都是 1456×624)。所以当前最宽只能到 21:9(2.33)。 |
| resolution | 否 | string | "1K"(默认)/ "2K" / "4K"。分档计价:1K $0.008、2K $0.015、4K $0.025。 |
| image_url | 否 | string | 单张参考图 URL,传入则走图生图 |
| image_urls | 否 | string[] | 多张参考图 URL,用于多图融合 |
| image_base64 | 否 | string | Base64 或 data URI 参考图(本地文件用) |
| image_mime_type | 否 | string | image_base64 对应的 MIME,默认 image/png |
| output_format | 否 | string | 交付格式:"png" / "jpeg" / "webp"。省略时:不透明图交付 JPEG q95、带透明通道的图保持 PNG。传 "png" 得到无损原图(不做任何重编码),体积约为 JPEG 的 6 倍;"webp" 体积与 JPEG 相当且保留透明通道。 |
| n | 否 | integer | 生成数量 1-10(默认 1),按张数线性扣费 |
| callback_url | 否 | string | 任务完成后的回调 URL |
| 字段 | 必填 | 类型 | 说明 |
|---|---|---|---|
| code | — | integer | 200 表示成功;其他见错误码表 |
| data.taskId | — | string | 任务 ID |
| data.state | — | string | completed / failed(同步,创建后状态通常已是 completed) |
| data.resultUrls | — | string[] | R2 托管的图片 URL |
| data.failMsg | — | string | 失败原因(state=failed 时) |
| data.costTime | — | integer | 耗时(ms) |
相关:异步任务式契约与更多比例枚举见 GPT Image 2;试一试:Playground
按分辨率档计价(medium 质量):1K $0.008、2K $0.015、4K $0.025 每张,与比例、参考图数量无关,是 apimodels.app 上 GPT Image 2 系列的最低价。失败不扣费。
支持 —— 传 resolution:"2K" 或 "4K"(默认 1K)。各档均为原生输出(2K 约 4MP、4K 最高 8.3MP),不是放大出来的。
出图中位约 41 秒,是 gpt-image-2 家族里最快的一档。POST 创建会立刻返回 taskId 和 state=pending,所以默认是建任务 + 轮询(或用 callback_url)。想一次调用直接拿图,就传 OpenAI 风格的 size(如 1024x1024)且不带 callback_url。