Pixazo APIModelsGPT Image 2
Pixazo APIModelsGPT Image 2

GPT Image 2 API, GPT Image 1.5 API: Pricing, Documentation

by OpenAI

GPT Image 2 API, developers can create images that accurately reflect complex prompts, edit existing images with natural language instructions, and generate variations. The API combines GPT's language understanding with powerful image generation for intuitive creative workflows.

Get API Key
GPT Image API

Models Version

WELCOME BONUS

Get $5 Free Credit on First Payment

No strings attached — add funds and get $5 bonus instantly

Claim Your $5 →

GPT Image 2 API Documentation

https://gateway.pixazo.ai/gpt-image-2/v1/text-to-image

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Text to Image - GPT Image 2

Request Code

POST https://gateway.pixazo.ai/gpt-image-2/v1/text-to-image
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "A serene sunset over mountains"
}
import requests

url = "https://gateway.pixazo.ai/gpt-image-2/v1/text-to-image"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
  "prompt": "A serene sunset over mountains"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/gpt-image-2/v1/text-to-image';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_API_KEY'
};
const data = {
  prompt: 'A serene sunset over mountains'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/gpt-image-2/v1/text-to-image" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
  "prompt": "A serene sunset over mountains"
}'

Output

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-2",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-2",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Text to Image

Parameter Required Type Default Allowed values / range Description
promptYesstringUp to 32,000 charactersText description of the desired image. Must be non-empty.
nNointeger11–10Number of images to generate in one request.
sizeNostring"auto"1024x1024, 1024x1536, 1536x1024, 2048x2048, 2048x1152, 2160x3840, 3840x2160, auto, or custom W×HOutput dimensions. Custom sizes: both edges multiples of 16px, longest edge up to 3840px, aspect ratio up to 3:1, total pixels 655,360–8,294,400.
qualityNostring"auto"low, medium, high, autoRendering quality. Higher = more detail, longer latency, higher cost.
formatNostring"png"png, jpeg, webpOutput file format. jpeg is fastest.
output_compressionNointeger1000–100Compression level for jpeg / webp output (no effect on png).
backgroundNostring"auto"opaque, autoBackground handling. transparent is NOT supported for gpt-image-2.
moderationNostring"auto"auto, lowContent moderation strictness. low is less restrictive.

Example Request

{
  "prompt": "Photorealistic 2K landscape of a fjord at golden hour, dramatic clouds, ultra-detailed",
  "n": 4,
  "size": "2048x1152",
  "quality": "high",
  "format": "webp",
  "output_compression": 80,
  "background": "opaque",
  "moderation": "low"
}

Response

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_API_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'gpt-image-2' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-2",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-2",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

GPT Image 2 API Pricing

ResolutionPrice (USD)
1024x1024 (Low)$0.006
1024x1536 (Low)$0.005
1536x1024 (Low)$0.005
1024x1024 (Medium)$0.053
1024x1536 (Medium)$0.041
1536x1024 (Medium)$0.041
1024x1024 (High)$0.211
1024x1536 (High)$0.165
1536x1024 (High)$0.165
Image to Image (Image Editing)

GPT Image 2 API Documentation

https://gateway.pixazo.ai/gpt-image-2/v1/image-to-image-edit

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Image to Image (Edit Image) - GPT Image 2

Request Code

POST https://gateway.pixazo.ai/gpt-image-2/v1/image-to-image-edit
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "Add a flamingo to the pool",
  "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/gpt-images-2/img_c86ec1806237_0.png"
}
import requests

url = "https://gateway.pixazo.ai/gpt-image-2/v1/image-to-image-edit"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
  "prompt": "Add a flamingo to the pool",
  "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/gpt-images-2/img_c86ec1806237_0.png"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/gpt-image-2/v1/image-to-image-edit';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_API_KEY'
};
const data = {
  prompt: 'Add a flamingo to the pool',
  image: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/gpt-images-2/img_c86ec1806237_0.png'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/gpt-image-2/v1/image-to-image-edit" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
  "prompt": "Add a flamingo to the pool",
  "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/gpt-images-2/img_c86ec1806237_0.png"
}'

Output

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-2",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-2",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Image Edit

Parameter Required Type Default Allowed values / range Description
promptYesstringUp to 32,000 charactersText instruction describing the edit. Must be non-empty.
imageYesstring or string[]Up to 16 imagesInput image(s) to edit — each an HTTPS URL or a data:image/...;base64,... URI. Pass an array (up to 16) to combine multiple references.
maskNostringPNG with an alpha channel, same dimensions as the first input imageIn-painting mask — fully transparent areas (alpha = 0) mark the region to edit; opaque areas are preserved. Applied to the first input image. HTTPS URL or base64 data URI.
nNointeger11–10Number of output variations to generate.
sizeNostring"auto"1024x1024, 1024x1536, 1536x1024, 2048x2048, 2048x1152, 2160x3840, 3840x2160, auto, or custom W×HOutput dimensions. Custom sizes: both edges multiples of 16px, longest edge up to 3840px, aspect ratio up to 3:1, total pixels 655,360–8,294,400.
qualityNostring"auto"low, medium, high, autoRendering quality. Higher = more detail, longer latency, higher cost.
formatNostring"png"png, jpeg, webpOutput file format. jpeg is fastest.
output_compressionNointeger1000–100Compression level for jpeg / webp output (no effect on png).
backgroundNostring"auto"opaque, autoBackground handling. transparent is NOT supported for gpt-image-2.
moderationNostring"auto"auto, lowContent moderation strictness. low is less restrictive.

Content Item Types & Limits

TypeMaxFormat / SizeDescription
image16JPG, PNG, WEBP · < 50 MBImage(s) to edit (up to 16).
mask1PNG (black & white) · < 4 MBOptional mask; must match image size.

Input image requirements: HTTPS URL or data:image/...;base64,... data-URI. PNG, JPEG, or WEBP. Multiple input images may be combined in a single edit request via the image array.

Edit-specific Notes

  • image as array — each entry is independently resolved (URL fetched, or base64 decoded). All are uploaded as repeated image[] parts. Useful for "combine these references" workflows.
  • mask semantics — must match the input image's dimensions. White pixels are editable; black pixels are preserved. PNG with alpha is accepted (transparent = editable). If mask is omitted, the entire image is in scope for the edit.
  • Multi-image + mask together — allowed, but the mask applies to the first input image only.
  • transparent background — NOT supported on gpt-image-2 (only opaque and auto).

Example Request

{
  "prompt": "Compose a gift basket containing all items, photorealistic, white background, with a Relax & Unwind ribbon",
  "image": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/seedream-5-0-lite-text-to-image_019ecace-485b-7447-c8d1-ce0344929afed/output.png",
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/nano-banana-pro_019ed0b0-e2d6-70d5-7724-7322947d78d18/output.jpg",
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/recraft/a-red-cat-1781619282400-0.webp"
  ],
  "n": 1,
  "size": "1024x1024",
  "quality": "high",
  "format": "png",
  "output_compression": 90,
  "background": "opaque",
  "moderation": "auto"
}

Response

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_API_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'gpt-image-2' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-2",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-2",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-2_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

GPT Image 2 API Pricing

ResolutionPrice (USD)
1024x1024 (Low)$0.006
1024x1536 (Low)$0.005
1536x1024 (Low)$0.005
1024x1024 (Medium)$0.053
1024x1536 (Medium)$0.041
1536x1024 (Medium)$0.041
1024x1024 (High)$0.211
1024x1536 (High)$0.165
1536x1024 (High)$0.165
2. GPT Image v1.5

GPT Image v1.5 API Documentation

https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

GPT-Image 1.5 API generate request - GPT Image 1.5 API

Request Code

POST https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912",
  "image_size": "1024x1024",
  "background": "auto",
  "quality": "high",
  "num_images": 1,
  "output_format": "png"
}
import requests

url = "https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912",
    "image_size": "1024x1024",
    "background": "auto",
    "quality": "high",
    "num_images": 1,
    "output_format": "png"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
  prompt: 'create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912',
  image_size: '1024x1024',
  background: 'auto',
  quality: 'high',
  num_images: 1,
  output_format: 'png'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/gpt-image-1-5-api-923/v1/gpt-image-1-5-api-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912",
    "image_size": "1024x1024",
    "background": "auto",
    "quality": "high",
    "num_images": 1,
    "output_format": "png"
  }'

Output

{
  "request_id": "gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-1-5-api-923",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-1-5-api-923",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - GPT-Image 1.5 API generate request

Parameter Required Type Default Allowed values / range Description
promptYesstring2–32,000 charactersDetailed text description of the desired image (2–32,000 characters).
image_sizeNostring"1024x1024"1024x1024, 1536x1024, 1024x1536Output dimensions — square, landscape, or portrait.
qualityNostring"high"low, medium, highRendering quality. Higher = more detail, longer latency.
backgroundNostring"auto"auto, transparent, opaqueBackground handling. transparent requires output_format = png or webp.
num_imagesNointeger11–4Number of images to generate in one request.
output_formatNostring"png"jpeg, png, webpOutput file format.
sync_modeNobooleanfalseIf true, returns the image as a base64-encoded data URI inline in the response. If false, returns hosted image URLs via the async queue.

Example Request

{
  "prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912",
  "image_size": "1024x1024",
  "background": "auto",
  "quality": "high",
  "num_images": 1,
  "output_format": "png"
}

Response

{
  "request_id": "gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'gpt-image-1-5-api-923' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-1-5-api-923",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "gpt-image-1-5-api-923_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-1-5-api-923",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-1-5-api-923_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

GPT Image v1.5 API Pricing

Variants map to quality tiers: Variant 1 = Low, Variant 2 = Medium, Variant 3 = High. Higher = more detail and better prompt adherence at higher cost and latency.

ResolutionModelPrice (USD)
1024x1024low-1024x1024$0.009
1024x1536low-1024x1536$0.013
1536x1024low-1536x1024$0.013
1024x1024medium-1024x1024$0.034
1024x1536medium-1024x1536$0.051
1536x1024medium-1536x1024$0.05
1024x1024high-1024x1024$0.133
1024x1536high-1024x1536$0.20
1536x1024high-1536x1024$0.199
Image to Image (Image Editing)

GPT Image v1.5 API Documentation

https://gateway.pixazo.ai/gpt-image-1-5/v1/image-to-image/editing

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

GPT Image 1.5 Edit generate request

Request Code

POST https://gateway.pixazo.ai/gpt-image-1-5/v1/image-to-image/editing
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "Replace the sky with a dramatic sunset and add a flock of birds in the distance",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
  ],
  "num_images": 1,
  "image_size": "auto",
  "background": "auto",
  "quality": "high",
  "input_fidelity": "high",
  "output_format": "png",
  "sync_mode": false
}
import requests

url = "https://gateway.pixazo.ai/gpt-image-1-5/v1/image-to-image/editing"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "Replace the sky with a dramatic sunset and add a flock of birds in the distance",
    "image_urls": [
        "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
    ],
    "num_images": 1,
    "image_size": "auto",
    "background": "auto",
    "quality": "high",
    "input_fidelity": "high",
    "output_format": "png",
    "sync_mode": false
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://gateway.pixazo.ai/gpt-image-1-5/v1/image-to-image/editing";
const headers = {
  "Content-Type": "application/json",
  "Cache-Control": "no-cache",
  "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
};
const data = {
  "prompt": "Replace the sky with a dramatic sunset and add a flock of birds in the distance",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
  ],
  "num_images": 1,
  "image_size": "auto",
  "background": "auto",
  "quality": "high",
  "input_fidelity": "high",
  "output_format": "png",
  "sync_mode": false
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST "https://gateway.pixazo.ai/gpt-image-1-5/v1/image-to-image/editing" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "Replace the sky with a dramatic sunset and add a flock of birds in the distance",
    "image_urls": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
    ],
    "num_images": 1,
    "image_size": "auto",
    "background": "auto",
    "quality": "high",
    "input_fidelity": "high",
    "output_format": "png",
    "sync_mode": false
  }'

Output

{
  "request_id": "gpt-image-1-5_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-1-5_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.

X-Webhook-URL: https://your-server.com/webhook/callback

Request Parameters - GPT Image 1.5 Edit generate request

Parameter Required Type Default Allowed values / range Description
promptYesstring2–32,000 charactersText description of the desired edit (2–32,000 characters). Must clearly specify changes to the reference image.
image_urlsYesstring[]Array of one or more URLs pointing to reference images to be edited. Must be publicly accessible.
num_imagesNointeger11, 2, 3, 4Number of edited images to generate. Allowed values: 1, 2, 3, 4.
image_sizeNoenum"auto"auto, 1024x1024, 1536x1024, 1024x1536Output image dimensions. Allowed values: `auto`, `1024x1024`, `1536x1024`, `1024x1536`. `auto` selects size based on input image.
backgroundNoenum"auto"auto, transparent, opaqueBackground handling for output. Allowed values: `auto`, `transparent`, `opaque`. `transparent` removes background; `opaque` fills with neutral tone.
qualityNoenum"high"low, medium, highOutput quality and rendering detail. Allowed values: `low`, `medium`, `high`. Pricing: low $0.009, medium $0.034, high $0.133 per 1024x1024 image.
input_fidelityNoenum"high"low, highDegree to which the original image structure is preserved. Allowed values: `low`, `high`. Higher fidelity retains more texture and detail.
output_formatNoenum"png"jpeg, png, webpFile format of generated images. Allowed values: `jpeg`, `png`, `webp`.
mask_image_urlNostringURL to a grayscale mask image indicating regions to edit. White areas = edit zone; black = preserve. Must match input image dimensions.
sync_modeNobooleanfalseIf `true`, returns media as base64-encoded data URI inline in the response. If `false`, returns a polling ID and async output URL.

Content Item Types & Limits

TypeMaxFormat / SizeDescription
image_urlsJPG, PNG, WEBP · < 50 MBImage(s) to edit.
mask_image_url1PNG (grayscale) · < 4 MBOptional mask; must match image size.

Example Request

{
  "prompt": "Replace the sky with a dramatic sunset and add a flock of birds in the distance",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/nano-banana-2-image-to-image-batch_019eacab-dc06-7502-95d0-927f64f29bb60/output.jpg"
  ],
  "num_images": 1,
  "image_size": "auto",
  "background": "auto",
  "quality": "high",
  "input_fidelity": "high",
  "output_format": "png",
  "sync_mode": false
}

Response

{
  "request_id": "gpt-image-1-5_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-1-5_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_API_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'gpt-image-1-5' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "gpt-image-1-5_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-1-5",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/gpt-image-1-5_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "gpt-image-1-5_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-1-5",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-1-5_019dxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstringWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

GPT Image v1.5 API Pricing

ResolutionModelPrice (USD)
1024x1024low-1024x1024$0.009
1024x1536low-1024x1536$0.013
1536x1024low-1536x1024$0.013
1024x1024medium-1024x1024$0.034
1024x1536medium-1024x1536$0.051
1536x1024medium-1536x1024$0.05
1024x1024high-1024x1024$0.133
1024x1536high-1024x1536$0.20
1536x1024high-1536x1024$0.199