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 | OpenAI quality tiers, custom sizes, larger outputs, and image editing. |
gpt-image-1.5 | Fast GPT image generation and editing with strong text rendering. |
GPT Image fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Use gpt-image-2 or gpt-image-1.5. |
prompt | string | Yes | Image prompt, up to the selected model's prompt limit. |
image | string or string[] | Required for edit | Input image URL, or an array of image URLs when multiple references are supported. |
n | number | No | Number of images. Only 1 is currently supported. |
size | string | No | auto, popular preset sizes such as 1024x1024, 1536x1024, or 1024x1536, or a custom WIDTHxHEIGHT value. |
quality | string | No | low, medium, high, or auto when supported. |
Custom sizes must use the WIDTHxHEIGHT format, stay within the provider limits, and fit the selected output tier.
Pricing
| Model | Credits per image |
|---|---|
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, 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',
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",
"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"
}
]
}