Appearance
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
| Operation | Endpoint | Mode |
|---|---|---|
| Image generation | POST /v1/images/generations | Sync |
| Image generation task | POST /v1/async/images/generations | Async |
| Image editing | POST /v1/images/edits | Sync |
| Image editing task | POST /v1/async/images/edits | Async |
Model ids
| Model id | Best for |
|---|---|
gpt-image-2.5-flare | Speed-oriented generation, product variations, and high-volume creation. |
gpt-image-2.5-sunburst | Quality-oriented compositions, campaign assets, and precise image editing. |
gpt-image-2 | OpenAI quality tiers, custom sizes, larger outputs, and image editing. |
gpt-image-1.5 | Fast 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.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | gpt-image-2, gpt-image-1.5, gpt-image-2.5-flare, gpt-image-2.5-sunburst. Case-sensitive model ID. |
prompt | string | Yes | Describe the subject, composition, style, and requested edits. Pixapi keeps the first 2,000 characters; provide a non-empty prompt for both generation and editing. |
n | integer | No | Default 1; only integer 1 is supported. |
size | string | No | Use 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. |
image | string / string[] | For edits | Public HTTP(S) image URL or URL array; required on /images/edits. Up to 14 URLs; Base64 input is not supported. |
quality | string | No | auto (default), low, medium, or high. Higher quality can take longer. |
providerOptions | object | No | Model-specific options; see the table below. |
providerOptions
All fields in this table are nested inside providerOptions, not alongside model.
| Field | Type | Description |
|---|---|---|
output_format | string | Output image format: png (default, keeps transparency), jpeg (smaller files, no alpha), or webp (supports transparency). |
background | string | Background 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. |
moderation | string | Content moderation strictness: auto or low (more permissive). Default: auto for 1.5/2, low for 2.5. |
output_compression | integer | Output compression level 0–100; applies only to jpeg and webp output. |
mask_url | string | Public 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_check | boolean | Optional 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:
| Limit | Requirement |
|---|---|
| Multiple of 16 | Both width and height must be divisible by 16. |
| Aspect ratio | Between 1:3 and 3:1. |
| Longest edge | No edge may exceed 3840px. |
| Minimum pixels | At least 655,360 (about 1024x640). |
| Maximum pixels | At 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:
| Layout | Size | Total pixels |
|---|---|---|
| Landscape | 3840x2160 | 8,294,400 |
| Portrait | 2160x3840 | 8,294,400 |
| Square | 2880x2880 | 8,294,400 |
| Ultra-wide 3:1 | 3840x1280 | 4,915,200 |
Outputs above 2560x1440 are experimental and their stability is not guaranteed.
Pricing
| Model | Credits per image |
|---|---|
gpt-image-2.5-flare | from 1 |
gpt-image-2.5-sunburst | from 1 |
gpt-image-2 | from 1 |
gpt-image-1.5 | from 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 tier | Long edge | low | medium | high / auto |
|---|---|---|---|---|
| 1K | <= 1536px | 1 | 4 | 14 |
| 2K | <= 2048px | 2 | 17 | 67 |
| 4K | <= 3840px | 4 | 34 | 133 |
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"
}
]
}