Developer docs/gpt-image-2-1k

GPT Image 2 · 1K

gpt-image-2-1k

GPT Image 2 · 1K is the recommended OpenAI image id on LumeAPI for standard generations and img2img flows.

Overview

Official $0.0584
LumeAPI $0.05
POST /v1/images/generations
Base: https://api.lumeapi.site/v1

Auth: Authorization: Bearer sk-… from the Console. Use this model id exactly in the model field.

Request parameters — Image generations

Only parameters relevant to gpt-image-2-1k are listed below.

FieldTypeReqDescription
modelstringgpt-image-2-1k | gpt-image-2-2k | gpt-image-2 (legacy 1K alias) | doubao-seedream-5.0 | grok-4-image | grok-4.2-image — exact catalog ids only
promptstringText description of the image
sizestringgpt-image-2-1k / gpt-image-2-2k: aspect ratio 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 3:2 | 2:3 | … (or legacy WxH — gateway maps to ratio). gpt-image-2 (legacy alias for 1K). grok-4*: alias for aspect_ratio. doubao-seedream-5.0: aspect ratio + resolution 2K|3K|4K
aspect_ratiostringgrok-4-image / grok-4.2-image: 1:1 | 16:9 | 9:16 | 4:3 | 3:4 (default 1:1). Alias: size.
resolutionstringgpt-image-2-1k → 1k; gpt-image-2-2k → 2k; gpt-image-2 legacy alias → 1k (optional resolution extra for 4k). grok-4*: 1k (default) | 2k. Prefer gpt-image-2-1k / gpt-image-2-2k.
nintegerImages to generate. gpt-image-2: fixed 1. grok-4*: 1–10. Billed per successful image.
qualitystringgrok-4*: low (default) | medium | high. Ignored for gpt-image-2.
image_urlsstring[]Img2img reference (gpt-image-2 only). Up to 16 URLs or data URIs (gateway may enforce lower limits). Grok: use POST /v1/images/edits instead.
imagestring | string[]Legacy alias — gateway maps to image_urls for gpt-image-2. seedream: still accepts image.
strengthnumberLegacy img2img field — not used for gpt-image-2.

Notes

FieldTypeReqDescription
Img2img (gpt-image-2)When image_urls or image is present, pass up to 5–16 reference URLs/data URIs (gateway enforces per-request limits). Prefer aspect-ratio size values such as 1:1 | 16:9 | 9:16.
Gateway onlyCall ONLY https://api.lumeapi.site/v1 with your LumeAPI sk-… key. Do not call any third-party API host directly.
Sync responseGPT Image 2 & Grok Image: one HTTP response with standard OpenAI { data: [{ url }] } (30–90s typical). The gateway handles async work server-side. Do NOT call GET /v1/tasks/{id} on our gateway.
Unexpected task_idIf you get task_id back in ~0.3s with no url, contact support — your request format is likely correct; success looks like { data: [{ url }] } after 30–90s.
2K tierUse model id gpt-image-2-2k (not gpt-image-2 + quality=high).

Examples

bash
curl https://api.lumeapi.site/v1/images/generations \
  -H "Authorization: Bearer sk-…" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A minimalist product photo of wireless earbuds on marble",
    "size": "16:9",
    "n": 1
  }'
bash
curl https://api.lumeapi.site/v1/images/generations \
  -H "Authorization: Bearer sk-…" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2-2k",
    "prompt": "Same product in a modern mall scene, soft ambient light",
    "image_urls": ["https://cdn.example.com/product-reference.jpg"],
    "size": "9:16",
    "n": 1
  }'

Image integration notes

1. Base URL & auth

POST https://api.lumeapi.site/v1/images/generations or /v1/chat/completions with Authorization: Bearer sk-…. Obtain keys at the LumeAPI Console (/console). Catalog: GET /api/models on the LumeAPI portal API.

2. Model ids (exact match)

images/generations: gpt-image-2, gpt-image-2-2k, doubao-seedream-5.0, grok-4-image, grok-4.2-image. images/edits: grok-4-image, grok-4.2-image (multipart). chat/completions for Gemini Flash / Nano Banana: gemini-3.1-flash-image-preview, gemini-3.1-flash-image-preview-2k, google/gemini-3-pro-image-preview.

3. GPT Image 2 & Grok Image

One POST returns sync OpenAI { data: [{ url }] } after the gateway finishes (typically 30–90s). Do NOT poll /v1/tasks yourself. size = aspect ratio (16:9); 2K → model gpt-image-2-2k. With image_urls: pass reference images (gateway enforces max). Grok: aspect_ratio or size; resolution 1k|2k; quality low|medium|high; n 1–10. For Grok edits use POST /v1/images/edits with one image file. HTTP read timeout ≥ 180s.

4. Seedream & Gemini Flash

doubao-seedream-5.0: POST /v1/images/generations with aspect ratio size + resolution 2K (default). Sync { data: [{ url }] } after 30–90s. gemini-3.1-flash-image-preview*: POST /v1/chat/completions with modalities + image_config.

5. Billing & errors

Flat USD per image (see pricing tables). 402 insufficient_user_quota when balance empty. Failed generations return 4xx/5xx with error message.

6. If you still get task_id in ~0.3s

Contact support — success should be { data: [{ url }] } after 30–90s. Your request format is likely correct.

Errors

  • 401 — invalid or missing Bearer key
  • 402 — insufficient wallet balance (top up in Account)
  • 403 — model id not on the whitelist / wrong id spelling
  • 429 — rate limited; back off and retry
  • 502 — temporary gateway error; retry