APIMODELSAPIMODELS
Документация API

apimodels.app

Docs/GPT Image 2 Lite API

GPT Image 2 Lite API

The most affordable GPT Image 2 channel on the platform, at a flat $0.01 per image — actual output is ~1.5MP at your aspect ratio (larger than nominal 1K); the 2K/4K tiers were retired on 2026-08-31, use gpt-image-2 for those. The quality parameter is ignored on lite (accepted but has no effect; use gpt-image-2 or gpt-image-2-all if you need quality control). One endpoint auto-routes text-to-image and image editing (reference images + multi-image fusion), with synchronous responses — no polling.

Authentication

Authorization: Bearer YOUR_API_KEY

Model & pricing

ModelmodelPriceNotes
GPT Image 2 Litegpt-image-2-lite$0.01 /image (~1.5MP)Sync · single ~1.5MP tier · text-to-image + editing

Code examples

POST/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"

Request parameters

FieldRequiredTypeDescription
modelYesstringMust be "gpt-image-2-lite"
promptYesstringPrompt or editing instructions. When editing multiple images, reference them as "image 1", "image 2".
aspect_ratioNostring"auto" (default) or a W:H value such as 1:1 / 16:9 / 9:16 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9. Note on auto: when editing, it follows the reference image; for text-to-image there is nothing to follow, so it falls back to a 1:1 square rather than letting the model choose. Pick an enum value when you need a shape. Two things measured on 2026-08-13: asking for a ratio in the prompt does nothing (prompt-only "5:2" with no size still returned 1024x1024), and an exact size outside the enum is snapped to the nearest grid step (1600x640 for 5:2 and 1552x656 for 21:9 both came back 1456x624). The widest shape currently reachable is 21:9 (2.33).
resolutionNostringOptional (single 1K tier). "2K"/"4K" return a 400 — retired 2026-08-31, use gpt-image-2.
image_urlNostringSingle reference image URL — providing it routes to image editing.
image_urlsNostring[]Multiple reference image URLs for multi-image fusion.
image_base64NostringBase64 or data-URI reference image (for local files).
image_mime_typeNostringMIME type of image_base64. Default image/png.
output_formatNostringDelivery format: "png" / "jpeg" / "webp". When omitted: opaque images are delivered as JPEG q95, images with an alpha channel stay PNG. Pass "png" for the lossless original (no re-encode), at roughly 6x the JPEG size; "webp" is JPEG-sized and keeps an alpha channel.
nNointegerNumber of images 1-10 (default 1). Linear cost per image.
callback_urlNostringWebhook URL called when task completes.

Response fields

FieldRequiredTypeDescription
code—integer200 on success; otherwise see the error-code table.
data.taskId—stringTask ID.
data.state—stringcompleted / failed. Sync model — state is usually already completed when create returns.
data.resultUrls—string[]R2-hosted image URLs.
data.failMsg—stringFailure reason (when state=failed).
data.costTime—integerDuration in ms.

Notes

  • Sync model: POST create usually returns state=completed with resultUrls in the same call — no extra polling required. GET ?task_id= still works for compatibility and returns the same structure.
  • Endpoint auto-routes: prompt only → text-to-image; with image_url / image_urls / image_base64 → image editing.
  • A flat $0.01 per image, single tier — independent of aspect ratio and reference image count; actual output is ~1.5MP at your aspect ratio. The most affordable GPT Image 2 channel on the platform; for 2K/4K use gpt-image-2.
  • lite ignores the quality parameter: it is accepted without error but has no effect on output or billing. If you need quality control (medium/high), use gpt-image-2 or gpt-image-2-all instead.
  • Typical latency is 20-45s (longer at 4K); for sync calls set client timeouts to ≥90s.
  • Failed tasks are free: state=failed is not billed, safe to retry.

Related: for the async task contract and the full ratio enum see GPT Image 2; try it in the Playground

FAQ

How much does GPT Image 2 Lite cost?

A flat $0.01 per image, single tier — actual output ~1.5MP at your aspect ratio (2K/4K were retired on 2026-08-31) — independent of aspect ratio and reference count, the most affordable GPT Image 2 channel on apimodels.app. Failed requests are not billed.

Does GPT Image 2 Lite support 2K or 4K?

No — lite is single-tier since 2026-08-31 (~1.5MP at your ratio, larger than nominal 1K); "2K"/"4K" return a 400. Use gpt-image-2 for native 2K/4K.

How long does GPT Image 2 Lite take, and do I have to poll?

Median generation is about 41 seconds — the quickest tier in the gpt-image-2 family. The POST create call returns a taskId with state=pending straight away, so the default flow is create-then-poll (or a callback_url). To get the image back from one blocking call instead, pass an OpenAI-style size such as 1024x1024 and no callback_url.