Skip to main content
POST
Model selection: gpt-image-2.5-flare is faster and works well for everyday high-quality images, batch generation, and rapid prototyping. gpt-image-2.5-sunburst prioritizes editing precision for production assets, advertising creatives, and detailed multi-turn editing. Both models use the same pricing.

Authentication

string
required
All endpoints use Bearer Token authentication. Get your key from the API Key page.

Choose a model

The two models have identical token usage and pricing for the same parameters. Select one based on the speed-versus-quality tradeoff. Compared with gpt-image-2, GPT-Image-2.5 adds the xhigh and max quality levels. Its medium and high levels use roughly one quarter of the output tokens of the previous generation’s levels with the same names.

Request parameters

string
required
Image model name: gpt-image-2.5-flare or gpt-image-2.5-sunburst.
string
required
Text description of the image to generate or edit. Describe the subject, scene, composition, style, lighting, and anything that must be preserved or changed.
string
default:"auto"
Output aspect ratio or exact pixel dimensions.
  • auto: let the model choose from the prompt or reference images
  • Aspect ratio: 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 21:9, 9:21, 3:1, 1:3
  • Exact dimensions, such as 1600x1200
For image-to-image requests, omit size to let the service calculate dimensions from the input aspect ratio and resolution.
string
default:"1k"
Resolution tier used with an aspect-ratio size: 1k, 2k, or 4k. This field is ignored for exact pixel dimensions.
string
default:"auto"
Image quality: low, medium, high, xhigh, max, or auto.
xhigh and max are exclusive to GPT-Image-2.5. Sending them to gpt-image-2 returns HTTP 400; the request is not silently downgraded.
integer
default:"1"
Number of images to generate. Range: 1 to 4. Pass a number, not a string.
string
default:"png"
Output file format: png, jpeg, or webp.
integer
Compression level from 0 to 100. Only applies to jpeg and webp.
string
Background mode: transparent, opaque, or auto.
background: "transparent" requires output_format: "png" or output_format: "webp". JPEG has no alpha channel.
string
default:"low"
Content moderation level: auto or low. APIMart explicitly sends low when omitted; an explicit auto value is passed through.
string[]
Reference image URLs for image-to-image generation or editing. Up to 16 images are accepted, and including this field activates editing mode.Only publicly accessible HTTP(S) URLs are accepted. Upload local images with POST /v1/uploads/images, then use the returned url.

Size rules

Exact pixel dimensions must satisfy all of these constraints:
  • Width and height are both multiples of 16
  • Neither side exceeds 3840 pixels
  • Long-side to short-side ratio is at most 3:1
  • Total pixel count is between 655,360 and 8,294,400
Resolutions above 2560×1440 are experimental and may be less stable than common sizes.

Aspect ratio and resolution mapping

You may also pass any exact dimensions that satisfy the size rules; they do not need to appear in this table.

Usage examples

Text to image

Precision editing with Sunburst

Transparent background

Submission and task query

Successful submission immediately returns an asynchronous task ID. data is an array; read data[0].task_id. Call the task status endpoint with the returned ID. Poll every 2–5 seconds until the status becomes completed or failed. Use POST /v1/tasks/batch to query multiple tasks.
Image URLs are located at data.result.images[].url[]. Download and store them promptly instead of relying on temporary URLs.

Billing

GPT-Image-2.5 is billed by actual token usage. Flare and Sunburst use identical rates. Check the pricing page or /api/pricing for current account pricing.

1024×1024 output token reference

With quality: "auto", the model chooses the actual level at runtime. The service reserves funds using the max level for the selected size and settles against actual usage when the task finishes. Specify quality when available balance matters.
For n > 1, the reservation scales linearly with the requested image count. Final billing uses the number of images actually generated, and failed tasks are refunded automatically.

Output token reference

Values are per generated image. Actual billing also includes prompt and reference-image input tokens.

Limits and common errors

Response

integer
Response status code; 200 when submission succeeds.
array
Submission response data.