GPT Image 2.6 Official Group API

Generate and edit images, create GIFs and SVGs, and retrieve asynchronous results.

Use an Official Group API key with gpt-image-2.6-flare or gpt-image-2.6-sunburst. Try the Flare playground or the Sunburst playground. The playground includes examples for a capybara comic, boxed collectible, looping cat GIF, and coffee sticker. Fill and edit an example freely. Generate submits the billable task.

Integrate with a coding assistant

Read https://app.apipool.dev/docs/official/gpt-image-2-6.
Integrate this API into my project for image generation, editing, asynchronous task queries, and downloads.
Use the existing stack and read the API key from an environment variable. Explain where to set it and how to use the integration.

Choose a model or version

Flare suits quick drafts and iterative changes. Start with low. Sunburst suits detailed visuals and edits that need consistency across revisions. Try medium or high. Actual quality and speed depend on the prompt, settings, and workload. Both models support the same output modes and token rates. Change only the model ID to switch. Model introduction

Generate your first image

Create an Official Group key in API Keys and check your wallet balance. Substitute your key for YOUR_API_KEY and keep the Bearer prefix. Store your key on the server or in an environment variable. The curl examples work in macOS, Linux, or Windows Git Bash.

The example uses Flare at 1k, low, and n=1. To use Sunburst, set model to gpt-image-2.6-sunburst. Use the full model ID.

curl "https://app.apipool.dev/v1/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare",
    "prompt": "A capybara in a shirt sips tea at an office desk with red error dialogs behind it. Comic art. Put NO BIG DEAL at the top and TEA FIRST at the bottom.",
    "size": "1:1",
    "resolution": "1k",
    "quality": "low",
    "output_format": "png",
    "n": 1
  }'

HTTP 202 means the task was accepted. Save the complete id.

{
  "id": "imgtask_01...",
  "object": "image_generation.task",
  "status": "submitted",
  "model": "gpt-image-2.6-flare"
}

Query and download

Replace TASK_ID with that ID and use the original key.

curl "https://app.apipool.dev/v1/tasks/TASK_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"
StatusWhat to do
submitted, submission_unknown, processing, or meter_pendingWait a few seconds and check the same ID again.
completedDownload each data[].url.
failedRead error before trying again.

A completed response has this shape.

{
  "id": "imgtask_01...",
  "status": "completed",
  "data": [{ "url": "https://objects.example/result.png?..." }]
}

Open the returned URL directly. Downloads do not require an API key. Save files before expires_at. Within result_expires_at, query the original task for a fresh URL. Keep the ID even if your wait times out. Another submission creates a separate billable task. See asynchronous image tasks.

Edit your own image

Replace ./source.png with the path to your file, keeping the @ prefix. curl sets the multipart Content-Type.

curl "https://app.apipool.dev/v1/images/edits" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=gpt-image-2.6-flare" \
  -F "image=@./source.png" \
  -F "prompt=Turn the subject into a boxed collectible figure with recognizable facial features and appearance. Use clear blister packaging with a miniature laptop, iced coffee, and folding chair. Label the box OFFICE EDITION and show the entire package in a realistic toy photo." \
  -F "size=1:1" \
  -F "resolution=1k" \
  -F "quality=low" \
  -F "output_format=png" \
  -F "n=1"

Poll and download the result using the same steps. Repeat the image field to send up to 16 PNG, JPEG, or WebP files, up to 10 MB per file and 48 MB combined. Describe what to keep or change. Alternatively, provide up to 16 directly accessible URLs in image_urls in a JSON generation request. Use files for images that require login or are available only on your machine.

Make a GIF

curl "https://app.apipool.dev/v1/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare",
    "prompt": "A round ginger cat with crooked glasses types furiously with alternating paws. Its head bobs and a white cartoon puff rises from the keyboard. Use a fixed front view, cream background, and bold comic outlines. Make the movement loop seamlessly. No text.",
    "output_format": "gif",
    "size": "512x512",
    "frame_count": 9,
    "frame_duration_ms": 200,
    "quality": "low",
    "n": 1
  }'

The example creates one 512×512 GIF with nine frames at 200 milliseconds per frame, for a loop of about 1.8 seconds. Increase frame_duration_ms for slower motion. n counts files. GIF accepts text only. Query the task and download the GIF from data after completion.

Make an SVG

curl "https://app.apipool.dev/v1/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6-flare",
    "prompt": "A flat vector sticker of a sleepy battery with one red bar, connected to a large iced coffee by a charging cable. Label the battery 1%. Use thick dark-brown outlines, cream and mint fills, and rounded shapes. No gradients, textures, or shadows.",
    "output_format": "svg",
    "svg": { "model": "gpt-5.4-mini" },
    "size": "1:1",
    "resolution": "1k",
    "quality": "low",
    "n": 1
  }'

Keep svg.model set to gpt-5.4-mini. One SVG is returned and both image and SVG text usage are billed. References and frame parameters are unavailable. Omit svg.reasoning for default reasoning. Query the task and download the SVG from data.

Parameters

ParameterAccepted values
modelRequired. gpt-image-2.6-flare or gpt-image-2.6-sunburst.
promptRequired, up to 32,000 characters. For edits, describe what to keep and what to change.
sizeStatic ratios include auto, 1:1, 1:3, 3:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 21:9, and 9:21.
resolution1k, 2k, or 4k for static images and SVG.
qualityauto, low, medium, high, xhigh, or max.
nInteger 1–4. For SVG, set 1.
output_formatpng (default), jpeg, webp, gif, or svg.
image_urlsUp to 16 reference URLs in JSON.
imageUp to 16 multipart reference files. Use this or image_urls.
svg.modelRequired for SVG. Use gpt-5.4-mini.

For GIF, size gives frame pixels such as 512x512, and auto or omission defaults to 512×512. frame_count accepts 2–16 and defaults to 9. frame_duration_ms defaults to 200, with a minimum of 20 and rounding to the nearest 10 ms. Omit resolution for GIF. Custom sides must be multiples of 16. The sprite sheet is limited to 3,840 pixels per side, 8,294,400 total pixels, and a 3:1 maximum side ratio. A 768×768 GIF supports at most 12 frames.

Only PNG, JPEG, and WebP support references. stream, response_format, background, output_compression, masks, markup editing, and complexity are unavailable.

Pricing

Both models use the same token rates. Charges vary with actual usage. Prices below are in US dollars per million tokens and include the group discount.

MeterRate
Text input4.25
Cached text input1.0625
Image input6.80
Cached image input1.70
Image output25.50
SVG text input0.6375
SVG text output, including reasoning3.825

Static generation and editing use actual text and image usage. GIF bills the complete sprite sheet at the image rates. SVG also bills the text usage in usage.svg_usage. Its output_tokens include reasoning. See usage in the result and current prices on the Flare page and Sunburst page.

Troubleshooting

  • HTTP 202 without an image. Poll /v1/tasks/{id} with the returned ID.
  • HTTP 400. Check the exact model ID, output format, ratio, image count, and GIF or SVG requirements.
  • HTTP 401. Check the enabled key, the correct group, and the Bearer prefix.
  • HTTP 404. Check the full ID and use the key that created the task at https://app.apipool.dev.
  • Insufficient balance. Add funds and check any task ID already returned before submitting again.
  • Timeout during submission. Check recent tasks or contact support before repeating the request.
  • HTTP 429, 5xx, or timeout while polling. Follow Retry-After if present and query the same ID.
  • Reference download failure. Use a public image URL or upload the file.
  • Expired download URL. Query within the result retention period for a fresh link.

Use the asynchronous Images API. An SDK call returning a task ID requires a follow-up query before images are available. Chat Completions and Responses do not accept these models.