平台上最便宜的 GPT Image 2 通道:$0.008/张,固定 1K 档输出。同一端点自动路由文生图 / 图生图(参考图 + 多图融合),同步返回,无需轮询。要 2K/4K 高清请用 gpt-image-2。
Authorization: Bearer YOUR_API_KEY| 模型 | model | 价格 | 说明 |
|---|---|---|---|
| GPT Image 2 Lite | gpt-image-2-lite | $0.008/张 | 同步 · 1K · 文生图 + 图生图 |
/api/v1/images/generations# ─── 1. Text-to-image ──────────────────────────────────────
curl -X POST https://apimodels.app/api/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"
}'
# 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://apimodels.app/api/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://apimodels.app/api/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://apimodels.app/api/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 由模型自定构图;图生图 auto 跟随输入图比例 |
| image_url | 否 | string | 单张参考图 URL,传入则走图生图 |
| image_urls | 否 | string[] | 多张参考图 URL,用于多图融合 |
| image_base64 | 否 | string | Base64 或 data URI 参考图(本地文件用) |
| image_mime_type | 否 | string | image_base64 对应的 MIME,默认 image/png |
| 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) |
相关:2K/4K 高清与更强构图控制见 GPT Image 2;试一试:Playground
固定 $0.008/张,与比例、参考图数量无关,是 apimodels.app 上 GPT Image 2 系列的最低价。失败不扣费。
不支持 —— Lite 固定 1K 档,请求 2K/4K 会直接返回 400(不静默降级)。要高清请用 gpt-image-2(1K/2K/4K 分档)。
是。POST 创建通常直接返回 completed 和 resultUrls(典型 20-30 秒),无需轮询。