GPT Image 2 API: How to Call 2.6

By Kerox · Published Nov 29, 2026 · Updated Nov 29, 2026

Made with GPT Image 2.6 Flare

GPT Image 2.6 is OpenAI's image model for generating and editing from text and reference images. It shipped on 4 November 2026 as two versions: Flare for fast iteration, and Sunburst for detailed work. OpenAI's current recommendation for new integrations is the 2.6 pair, not the older GPT Image models. That account is from OpenAI's image generation guide and the Flare and Sunburst model pages, read on 29 November 2026.

On Kerox each version has two billing modes, so the "GPT Image 2 API" is four model IDs on one endpoint. A usage-based Flare image at low quality and 1K is $0.0210 for the output tokens alone. The walkthrough below uses that ID, then shows when to switch. Samples and the switcher live on the GPT Image 2.6 model page. Field-by-field docs: Flare API docs.

Four IDs, one request shape

Model IDUse it when
openai/gpt-image-2.6-flare-economyFlare, fixed price by resolution, one PNG. You know the cost before you start.
openai/gpt-image-2.6-sunburst-economySunburst, same fixed price shape, one PNG.
openai/gpt-image-2.6-flareFlare, billed on tokens. Up to 4 images, WebP or JPEG, transparent backgrounds, and the complexity control.
openai/gpt-image-2.6-sunburstSunburst, billed on tokens, with the same extra controls.

The per-image IDs are the ones to start with if you are porting a script that used to call a single "image" endpoint and you want a predictable bill. The usage-based IDs are the ones that match OpenAI's token meter, including quality levels from low through max and the complexity setting OpenAI added in 2.6. GPT Image 2.5 Flare and Sunburst already include xhigh and max; 2.6 keeps them. See size and quality options. Output goes up to 4K, within about 8.3 million pixels, which is OpenAI's stated ceiling on the pages linked above.

OpenAI also lists limits that still apply: precise text placement can fail, a character or logo may drift between generations, and a tightly specified layout is hard to hit exactly. Raise complexity on the usage-based models when the prompt is dense with text or with relationships between objects. The per-image models do not take complexity.

Create a key

Sign in at API keys, create a key, and put funds in the wallet. The minimum top-up is $5. Export the secret as KEROX_API_KEY and send Authorization: Bearer <your-api-key> from your server. Authentication covers rotation and per-key spend limits. The quickstart is the same loop with a different model ID.

Submit, poll, and save the PNG

POST https://api.kerox.ai/v1/tasks returns HTTP 201 and a task ID. Image tasks finish faster than video, but the contract is the same: poll GET /v1/tasks/{id} until succeeded or failed, then download outputs[0].url. The scripts wait up to 10 minutes. Files expire 7 days after the task finishes. Tasks documents the object.

# Needs curl and jq. KEROX_API_KEY is your key.
set -euo pipefail
API=https://api.kerox.ai/v1
AUTH="Authorization: Bearer $KEROX_API_KEY"
BODY='{
  "model": "openai/gpt-image-2.6-flare",
  "input": {
    "prompt": "Editorial still life of a brass microscope on a walnut desk, morning side light, 35mm film",
    "resolution": "1K",
    "aspect_ratio": "1:1",
    "quality": "high"
  }
}'

TASK_ID=$(curl -sS --fail-with-body -X POST "$API/tasks" \
  -H "$AUTH" -H "Content-Type: application/json" -d "$BODY" | jq -r .id)
echo "Submitted $TASK_ID"

DEADLINE=$(( $(date +%s) + 600 ))
STATUS=processing
while [ "$STATUS" = "processing" ] && [ "$(date +%s)" -lt "$DEADLINE" ]; do
  sleep 3
  TASK=$(curl -sS --fail-with-body "$API/tasks/$TASK_ID" -H "$AUTH")
  STATUS=$(echo "$TASK" | jq -r .status)
done

if [ "$STATUS" != "succeeded" ]; then
  echo "Task $TASK_ID is $STATUS: $(echo "$TASK" | jq -c .error)"
  exit 1
fi
curl -sS --fail-with-body -o result.png "$(echo "$TASK" | jq -r '.outputs[0].url')"
echo "Saved result.png"
# pip install requests
import os
import time
import requests

API = "https://api.kerox.ai/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['KEROX_API_KEY']}"}

resp = requests.post(
    f"{API}/tasks",
    headers=HEADERS,
    json={
        "model": "openai/gpt-image-2.6-flare",
        "input": {
            "prompt": "Editorial still life of a brass microscope on a walnut desk, morning side light, 35mm film",
            "resolution": "1K",
            "aspect_ratio": "1:1",
            "quality": "high",
        },
    },
    timeout=60,
)
if resp.status_code != 201:
    raise SystemExit(f"HTTP {resp.status_code}: {resp.json()['error']}")
task = resp.json()
print("Submitted", task["id"])

deadline = time.time() + 600
while task["status"] == "processing" and time.time() < deadline:
    time.sleep(3)
    task = requests.get(
        f"{API}/tasks/{task['id']}", headers=HEADERS, timeout=30
    ).json()

if task["status"] != "succeeded":
    raise SystemExit(f"Task {task['id']} is {task['status']}: {task.get('error')}")
file = requests.get(task["outputs"][0]["url"], timeout=120)
file.raise_for_status()
open("result.png", "wb").write(file.content)
print("Saved result.png")
// Node.js 18 or later. Save as generate.mjs and run: node generate.mjs
import fs from 'node:fs/promises';

const API = 'https://api.kerox.ai/v1';
const headers = { Authorization: `Bearer ${process.env.KEROX_API_KEY}` };

const res = await fetch(`${API}/tasks`, {
  method: 'POST',
  headers: { ...headers, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    model: 'openai/gpt-image-2.6-flare',
    input: {
      prompt:
        'Editorial still life of a brass microscope on a walnut desk, morning side light, 35mm film',
      resolution: '1K',
      aspect_ratio: '1:1',
      quality: 'high',
    },
  }),
});
let task = await res.json();
if (res.status !== 201)
  throw new Error(`HTTP ${res.status}: ${task.error.message}`);
console.log('Submitted', task.id);

const deadline = Date.now() + 10 * 60 * 1000;
while (task.status === 'processing' && Date.now() < deadline) {
  await new Promise((resolve) => setTimeout(resolve, 3000));
  const poll = await fetch(`${API}/tasks/${task.id}`, { headers });
  if (!poll.ok) throw new Error(`HTTP ${poll.status}`);
  task = await poll.json();
}
if (task.status !== 'succeeded') {
  throw new Error(
    `Task ${task.id} is ${task.status}: ${JSON.stringify(task.error)}`
  );
}
const file = await fetch(task.outputs[0].url);
if (!file.ok) throw new Error(`Download failed: HTTP ${file.status}`);
await fs.writeFile('result.png', Buffer.from(await file.arrayBuffer()));
console.log('Saved result.png');

To edit instead of generating from scratch, add images with up to 16 URLs and describe the change in the prompt. Upload local files first and pass the returned URLs: Files. A public sample you can point at while testing is the lighthouse sample.

Pass webhook_url if you do not want to poll. When the task reaches succeeded or failed, Kerox creates one notification and delivers it to a public https:// address. A failed delivery is retried, up to 12 attempts. Deduplicate on the webhook-id header. The console stores the signing secret, not this address. Webhooks.

{
  "model": "openai/gpt-image-2.6-flare-economy",
  "input": {
    "prompt": "Editorial still life of a brass microscope on a walnut desk, morning side light",
    "resolution": "2K",
    "aspect_ratio": "4:5",
    "quality": "high"
  },
  "webhook_url": "https://example.com/webhooks/kerox"
}

Idempotency-Key makes a retry safe: the same key and body within 24 hours return the original task and do not charge twice. Idempotency.

Parameters

Shared by all four IDs:

  • prompt. Required. 1 to 32,000 characters, and it cannot be only whitespace.
  • images. Optional. One URL, or an array of up to 16. HTTPS, or a data URL for PNG, JPEG, WebP, GIF, or BMP.
  • resolution. 1K (default), 2K, or 4K.
  • aspect_ratio. 1:1 (default), 3:2, 2:3, 4:3, 3:4, 16:9, 9:16, 21:9, or auto. The per-image models also accept 5:4 and 4:5.
  • quality. auto, low, medium, high, xhigh, or max.

Only the usage-based IDs (-flare and -sunburst without -economy):

  • n. 1 to 4 images. Default 1. The per-image IDs reject n.
  • output_format. png (default), webp, or jpeg.
  • background. auto (default), opaque, or transparent. Transparent requires PNG or WebP.
  • complexity. low, medium, or high (default high). This is the 2.6 planning control. It is not on the per-image IDs.

Rules that produce 400 if you miss them:

  • aspect_ratio: "auto" cannot sit next to resolution. Omit resolution and let the model size the image, or pick a concrete ratio and a resolution.
  • Do not send OpenAI's size string such as 1024x1024. This API uses resolution plus aspect_ratio. size, mask, moderation, stream, and response_format are not accepted.
  • Per-image calls are one PNG. Asking the economy ID for output_format or n is an unknown parameter. Switch IDs if you need those.
  • Transparent JPEG fails. Set output_format to png or webp when background is transparent.
  • Quality changes the usage bill, not the per-image bill. On the economy IDs the price tier is the resolution. On the usage IDs, low at 1K and max at 4K are different output-token counts. Read the table before you loop max.

POST /v1/estimate quotes the hold for the exact body. Studio shows it before you generate.

What it costs

Two meters, both read from the catalog rather than typed here.

Usage-based Flare and Sunburst follow OpenAI's token rates: text input, cached text, image input, cached image input, and image output. The table is only the image-output portion at that quality and size, before the public discount. A long prompt and any reference image are extra, and the task settles on the measured usage. The official column is the maker rate as stored in the catalog. The OpenAI pages linked above were read on 29 November 2026.

ModelOfficial priceKeroxYou save
GPT Image 2.6 Flare1 image · low · 1K$0.0247$0.021015%
GPT Image 2.6 Flare1 image · high · 2K$0.1070$0.091014%
GPT Image 2.6 Flare1 image · max · 4K$0.7116$0.604815%
GPT Image 2.6 Sunburst1 image · low · 1K$0.0247$0.021015%
GPT Image 2.6 Sunburst1 image · high · 2K$0.1070$0.091014%
GPT Image 2.6 Sunburst1 image · max · 4K$0.7116$0.604815%

Per-image Flare and Sunburst are a fixed Kerox price for one PNG at 1K, 2K, or 4K. The catalog does not publish a separate maker list price for these two IDs, so there is no official column. Reference images on this meter are included in the way the per-image rule is written; confirm the line you care about with POST /v1/estimate before a large batch.

ModelKerox
GPT Image 2.6 Flare Economy1 image · 1K$0.0150
GPT Image 2.6 Flare Economy1 image · 2K$0.0450
GPT Image 2.6 Flare Economy1 image · 4K$0.0600
GPT Image 2.6 Sunburst Economy1 image · 1K$0.0150
GPT Image 2.6 Sunburst Economy1 image · 2K$0.0450
GPT Image 2.6 Sunburst Economy1 image · 4K$0.0600

A failed task is refunded in full. The hold is taken when you submit and settled when the image is done. Pricing and billing.

When to change the ID

Stay on one ID per pipeline so retries and cost alerts stay comparable.

  • Drafts and tight loops: openai/gpt-image-2.6-flare-economy at 1K, then move the keeper to 2K or 4K.
  • Posters, small text, or a layout with several objects: openai/gpt-image-2.6-sunburst with complexity at high and quality at high or above.
  • A cutout: usage-based ID, background transparent, output_format png.
  • Four variations in one call: usage-based ID, n 4. That is four output images on the token meter.

If the job is video, this model will not do it. Seedance 2.5 and Kling 4.0 are the video calls on the same key. For a different still model, the model list includes Seedream and Qwen Image.

Errors

You gotWhat to do
HTTP 400 with paramThe named field is wrong. Typical cases: resolution together with aspect_ratio auto, n on an economy ID, transparent JPEG, an empty prompt. Fix and send a new body.
HTTP 401Missing or revoked API key.
HTTP 402Balance or key spend limit. Top up, or lower quality / resolution / n.
HTTP 413The body or an inline file is too large. Upload with the files API and pass URLs.
HTTP 429Respect retry-after when it is present. Otherwise wait for an in-progress task to finish.
status: "failed"Refunded. A content failure will fail again if you resubmit the same prompt unchanged.

Every code is listed in Errors. Include the x-request-id header if you write to hi@kerox.ai.

GPT Image 2.6, in one pass

Pick the ID for the meter you want, send a prompt plus resolution and aspect ratio, and poll the task. Use the economy IDs when the price must be known up front, and the usage-based IDs when you need n, file format, transparency, or complexity. The model page switches versions without a second account, and the API docs show a body for each mode.