Skip to content

GPT Image ​

GPT Image models are useful when prompt adherence, text rendering, clean composition, or large output sizes matter. Pixapi exposes them through OpenAI-compatible image endpoints.

API surface ​

OperationEndpointMode
Image generationPOST /v1/images/generationsSync
Image generation taskPOST /v1/async/images/generationsAsync
Image editingPOST /v1/images/editsSync
Image editing taskPOST /v1/async/images/editsAsync

Model ids ​

Model idBest for
gpt-image-2.5-flareSpeed-oriented generation, product variations, and high-volume creation.
gpt-image-2.5-sunburstQuality-oriented compositions, campaign assets, and precise image editing.
gpt-image-2OpenAI quality tiers, custom sizes, larger outputs, and image editing.
gpt-image-1.5Fast GPT image generation and editing with strong text rendering.

Flare and Sunburst use the same request parameters, synchronous/asynchronous generation and editing endpoints, and credit pricing as GPT Image 2. Change only the model value to switch models.

Request fields ​

Send the common fields at the top level. Put the model-specific controls listed below inside providerOptions.

FieldTypeRequiredDescription
modelstringYesgpt-image-2, gpt-image-1.5, gpt-image-2.5-flare, gpt-image-2.5-sunburst. Case-sensitive model ID.
promptstringYesDescribe the subject, composition, style, and requested edits. Pixapi keeps the first 2,000 characters; provide a non-empty prompt for both generation and editing.
nintegerNoDefault 1; only integer 1 is supported.
sizestringNoUse pixel dimensions WIDTHxHEIGHT, for example 1024x1024. Default auto. Custom dimensions: multiples of 16, longest edge ≤ 3840, aspect ratio ≤ 3:1, total pixels 655,360–8,294,400.
imagestring / string[]For editsPublic HTTP(S) image URL or URL array; required on /images/edits. Up to 14 URLs; Base64 input is not supported.
qualitystringNoauto (default), low, medium, or high. Higher quality can take longer.
providerOptionsobjectNoModel-specific options; see the table below.

providerOptions ​

All fields in this table are nested inside providerOptions, not alongside model.

FieldTypeDescription
output_formatstringOutput image format: png (default, keeps transparency), jpeg (smaller files, no alpha), or webp (supports transparency).
backgroundstringBackground mode: auto (default), opaque, or transparent. transparent can only be combined with output_format: "png" or output_format: "webp"; JPEG does not support an alpha channel.
moderationstringContent moderation strictness: auto or low (more permissive). Default: auto for 1.5/2, low for 2.5.
output_compressionintegerOutput compression level 0–100; applies only to jpeg and webp output.
mask_urlstringPublic PNG mask URL for inpainting. Requires image; dimensions must match the first image. Transparent pixels mark the area to edit. Use a PNG with an alpha channel, under 4 MB.
nsfw_checkbooleanOptional prompt/image moderation; default false.

Input rules ​

Pixapi accepts one output and up to 14 reference images. Output pixels are selected with size.

Custom sizes must use the WIDTHxHEIGHT format (for example 1536x864) and satisfy all of the following limits at once:

LimitRequirement
Multiple of 16Both width and height must be divisible by 16.
Aspect ratioBetween 1:3 and 3:1.
Longest edgeNo edge may exceed 3840px.
Minimum pixelsAt least 655,360 (about 1024x640).
Maximum pixelsAt most 8,294,400 (4K, equal to 3840x2160).

Because the ceiling is a total pixel count, 4K does not mean a 3840px long edge: on a square canvas the edge maxes out at 2880x2880 (√8,294,400 = 2880). Largest usable size per layout:

LayoutSizeTotal pixels
Landscape3840x21608,294,400
Portrait2160x38408,294,400
Square2880x28808,294,400
Ultra-wide 3:13840x12804,915,200

Outputs above 2560x1440 are experimental and their stability is not guaranteed.

Pricing ​

ModelCredits per image
gpt-image-2.5-flarefrom 1
gpt-image-2.5-sunburstfrom 1
gpt-image-2from 1
gpt-image-1.5from 1

gpt-image-1.5 is billed for 1K sizes only (1024x1024, 1536x1024, 1024x1536, or auto): low/medium/high is 1/4/14. It does not support 2K or 4K outputs.

For gpt-image-2, gpt-image-2.5-flare, and gpt-image-2.5-sunburst, credits follow the size and quality matrix below. quality=auto is billed as high, and size=auto defaults to the 1K tier.

Size tierLong edgelowmediumhigh / auto
1K<= 1536px1414
2K<= 2048px21767
4K<= 3840px434133

The displayed costCredits for a request equals the matrix value times n.

Generate example ​

ts
const response = await fetch('https://api.pixapi.ai/v1/images/generations', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PIXAPI_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'gpt-image-2.5-flare',
    prompt: 'A clean SaaS hero image showing API model orchestration',
    n: 1,
    size: '1536x1024',
    quality: 'high',
  }),
});

const image = await response.json();

Edit example ​

bash
curl https://api.pixapi.ai/v1/images/edits \
  -H "Authorization: Bearer $PIXAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.5-sunburst",
    "prompt": "Replace the background with a bright studio setup",
    "image": "https://cdn.example.com/input.png",
    "size": "auto",
    "quality": "auto"
  }'

Response ​

json
{
  "created": 1766880000,
  "data": [
    {
      "url": "https://cdn.pixapi.ai/generated/gpt-image.png"
    }
  ]
}