Skip to main content
POST
Text-to-image, editing, GIF, and SVG requests all use POST /v1/images/generations. Read data[0].task_id from the submission response, then query the task for file URLs.

Authentication

string
required
Use Bearer Token authentication. Get a key from the API Key page.

Choosing a model

Both models have the same token rates and consumption at identical settings. Choose based on speed and detail requirements.

Request parameters

string
required
Model name: gpt-image-2.6-flare or gpt-image-2.6-sunburst.
string
required
Generation or editing instructions, up to 32,000 characters. Describe the subject, composition, and what to change or preserve.
string
default:"auto"
Still images and SVG support 15 aspect ratios, exact pixels such as 1600x1200, or auto. Explicit auto lets the upstream model choose; omitting this field for editing selects dimensions from the first input image’s aspect ratio and resolution. GIF sizes follow separate rules below.
string
default:"1k"
1k / 2k / 4k, in lowercase. Combined with an aspect-ratio size to determine pixels; ignored when exact pixel dimensions are supplied.
string
default:"auto"
low / medium / high / xhigh / max / auto. Other values return HTTP 400 at submission. When omitted or set to auto, the model chooses the quality level automatically. The selected level may vary and is not fixed to low; specify a level explicitly if you need a fixed setting.When omitted or set to auto, funds are reserved at the max quality level and the final charge is settled at the level actually selected.
integer
default:"1"
Integer from 1 to 4; for GIF, this is the number of animations. SVG requires 1. Explicit 0, negative values, or values above 4 return HTTP 400 instead of falling back to the default.
string
default:"png"
png / jpeg / webp / gif / svg. GIF and SVG support text-to-image only. Other values return HTTP 400 at submission.
integer
Integer from 0 to 100, for jpeg / webp only. Out-of-range values or use with png / gif / svg return HTTP 400 at submission.
string
transparent / opaque / auto; omitted requests use the upstream default. Explicit transparent requires png / webp. SVG has a transparent background by default; omit this field for SVG.
string
default:"low"
Content moderation level: auto / low. Other values return HTTP 400 at submission.
string[]
Up to 16 reference images; providing them enables editing. Use publicly accessible HTTP(S) image URLs. For local files, use the image upload endpoint first and pass the returned url.
string
Inpainting mask, requiring image_urls. Use a PNG with an alpha channel matching the first input image’s dimensions; fully transparent regions indicate areas to edit. Accepts an image URL or PNG Data URL. Cannot be combined with markup; unchanged pixels outside the mask are not guaranteed.
string
Planning level: low / medium / high, with an upstream default of high, independent of rendering quality. Use low for focused edits and high for dense text, complex layouts, or object relationships; higher planning may be slower or introduce extra changes. No separate fee; supported only by 2.6.
string
Optional stable end-user identifier, up to 128 characters; a hash of a username or email is recommended. APIMart does not forward it upstream by default, only when the channel permits it. Omitting it does not affect usage.

Still image and SVG sizes

Exact pixel dimensions must be multiples of 16 on both axes, with each edge at most 3840, a longest-to-shortest edge ratio at most 3:1, and 655,360–8,294,400 total pixels. Resolutions above 2560×1440 are experimental. The mappings below match GPT-Image-2.5; do not apply these still-image limits directly to individual GIF frames.

Image editing and masks

This request edits a region of the first image. Omit mask_url to edit the whole image according to the prompt; omit size to derive output dimensions from the first image’s aspect ratio and resolution. Replace example image URLs with accessible files.

Markup-guided editing

Provide markup_url as an HTTPS or Base64 Data URL. The alias markup accepts a string or an {"image_url":"..."} object. file_id is not supported.
  • Include image_urls; markup applies to the first image, with any others used as references.
  • Use a separate transparent PNG overlay with exactly the same dimensions as the first image. Do not flatten annotations into the original image.
  • The first image and overlay must each contain at most 16,777,216 pixels; the overlay file must be at most 50 MB.
  • Do not combine with mask_url. The overlay incurs no image tokens, but the request may still incur additional text tokens.

Animated GIF output

Set output_format: "gif". Text-to-image only: do not include image_urls, mask_url, markup_url, markup, or output_compression. The upstream model arranges frames on a sheet: 4×2 for 2–8 frames, 3×3 for 9, 4×3 for 10–12, and 4×4 for 13–16. Rows and columns may be swapped to make the sheet closer to square. The whole sheet must have edges at most 3840, at most 8,294,400 pixels, and an aspect ratio at most 3:1; otherwise submission returns 400.
512x512 supports all 2–16 frames; 768x768 supports at most 12. Even 2 frames at 1024x1024 exceed the sheet’s edge limit. Billing uses the whole sheet for each animation; n > 1 generates and bills multiple animations.

SVG output

object
Set output_format: "svg". The image model first generates a reference image, then the text model specified in svg.model authors the SVG.
  • Text-to-image only, with n equal to 1. Do not provide reference images, masks, markup, or output_compression.
  • quality and complexity apply to the intermediate reference image. Output is a static .svg without scripts, external resources, or embedded bitmaps.
  • Text usage for svg.model is charged in addition to image generation. Accounts with fixed per-image pricing do not currently support SVG; submission returns 400.

Querying task results

Use the task status endpoint, polling every 2–5 seconds until completed or failed. Do not resubmit generation requests while waiting.
On completion, read file URLs from data.result.images[].url[] and download them promptly. Only key response fields are shown below; on failed, inspect data.error.message. Use POST /v1/tasks/batch to query multiple tasks.

SVG usage and response example

In task query responses, data.usage.svg_usage reports usage for the text model that authors the SVG. Other token fields in data.usage report usage for the image model that generates the reference image. Account for each part using its corresponding model’s billing rules. The following shows key fields of an SVG task response. Token values illustrate field relationships and are not fixed consumption estimates.

Common parameter errors

The following parameter validation errors return HTTP 400 synchronously at submission. No task is created and no charge is made. Correct the parameters before submitting again.

Unsupported parameters and billing

Do not send stream, partial_images, input_fidelity, prompt_rewriter, or response_format. This endpoint returns asynchronous tasks and CDN file URLs, not streamed partial images or Base64 image responses. frame_count / frame_duration_ms are GIF-only; the svg configuration is SVG-only. Flare and Sunburst use the same pricing. GPT-Image-2.6 consumes more tokens at low / medium than 2.5, so do not reuse older cost estimates unchanged. Current rates are available on the APIMart pricing page or through /api/pricing; this page lists no fixed prices. See the OpenAI image generation guide for upstream feature descriptions. For APIMart requests, use the endpoints, asynchronous responses, and limits documented here.