Skip to main content
POST
Use gpt-image-2.6-ext and select flare or sunburst with version. Billing is per image. Supported: resolution 1k / 2k / 4k with n: 1, all quality levels, and PNG / JPEG / WebP / SVG / GIF output.
This is the Ext API. Its model name and parameter rules differ from the token-billed GPT-Image-2.6 models.

Authentication

string
required
Authenticate with a platform API Key using Bearer Token. Get a key from the API Key page. Submit requests with Content-Type: application/json.

Version selection

Request parameters

Enum values are case-insensitive and trimmed. Examples use lowercase.
string
required
Must be gpt-image-2.6-ext.
string
required
Required, non-empty generation or editing instructions. For multiple references, identify the first or second image and describe what to change and preserve.
string
default:"flare"
flare / sunburst; defaults to flare. Other values return HTTP 400. Prices may differ between versions.
string
default:"1k"
1k / 2k / 4k (uppercase 1K / 2K / 4K also accepted). Combined with the size ratio to determine output pixels; see the “Aspect ratios and dimensions” table below. The per-image price varies by tier; other values such as hd / 8k return HTTP 400.
string
default:"auto"
Accepts auto or the 10 ratios below, not pixels such as 1024x1024. For text-to-image, auto gives 1:1. For editing, it matches the closest supported ratio to the first reference whose dimensions can be read. For GIF, omit this field or use auto.
string
Alias for size; use either one. If both are provided, they must match or submission returns HTTP 400. For GIF, also omit it or use auto.
integer
default:"1"
Currently use integer 1.
string
auto / low / medium / high / xhigh / max. Omitted values are not forwarded; the upstream model chooses automatically. auto is not fixed to low. Quality does not change the per-image price; higher levels usually take longer. Other values return HTTP 400.
string
default:"png"
png / jpeg / webp / svg / gif; jpg aliases jpeg. SVG and GIF support text-to-image only. Other formats return HTTP 400.
SVG output is not supported yet.
string
low / medium / high; omitted values are not forwarded and the upstream model decides. Controls scene complexity: low suits simple icons and flat illustrations; high suits richer detail. Does not change the per-image price.
string[]
Up to 16 images, each at most 20 MB; PNG / JPEG / WebP / GIF / BMP. Accepts public HTTP(S) URLs or image Base64 Data URLs such as data:image/png;base64,.... Providing references enables editing. SVG and GIF cannot include references.
When resolution is 2k / 4k, reference images cannot be GIF / BMP.
Accepted field aliases: image_url, image, images, input_image, input_images. Prefer image_urls. URLs must be publicly accessible without login.

Aspect ratios and dimensions

With auto, text-to-image uses 1:1: 1024×1024 at 1k, 2048×2048 at 2k, 2880×2880 at 4k. Editing selects the closest ratio in this table; it does not guarantee the original pixel dimensions.

Reference-image editing example

Editing also uses POST /v1/images/generations. Replace example URLs with accessible image files.

SVG output

Set output_format: "svg". Text-to-image only, with n=1. size accepts aspect ratios; complexity: "low" suits simple vector artwork.
object
Optional SVG authoring-model configuration, for SVG output only. The entire object may be omitted. The text model that authors the SVG incurs no additional charge.

Animated GIF output

Set output_format: "gif". Text-to-image only. Omit size / aspect_ratio or use auto; ratios and pixel dimensions return HTTP 400. Describe the motion and loop in the prompt.

Unsupported and ignored parameters

Submission and task results

Successful submission returns HTTP 200. Read data[0].task_id, then poll the task status endpoint every 3–5 seconds until completed or failed. If the client times out, keep querying that task instead of resubmitting generation.
The example below shows the task object. If the response uses a {code, data} wrapper, read data first. The Python / JavaScript examples handle either shape.
result.images[0].url is an array; its first link is result.images[0].url[0]. Download before expires_at; the recommended validity period is 24 hours after completion. cost / credits_cost report final charges. Batch queries use POST /v1/tasks/batch with {"task_ids":["task_xxx","task_yyy"]}.

Billing

The per-image price depends only on version × resolution. Quality, format (including SVG / GIF), complexity, ratio, reference count, and svg.model do not affect it. Currently use n=1; failed tasks are fully refunded. Check current rates on the APIMart pricing page or /api/pricing.

Error handling