Pixazo APIModelsGPT Image
Pixazo APIModelsGPT Image

GPT Image 2 API, GPT Image 1.5 API - AI Image Generation APIs

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

LIMITED TIME OFFER

Get $5 Free Credit on First Payment

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

Claim Your $5 →

GPT Image 2 Image to Image (Image Editing) API Documentation

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

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Image to Image - GPT Image 2 Image to Image Api

Request Code

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

{
  "prompt": "Transform this into a Studio Ghibli style anime illustration",
  "input_images": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"]
}
import requests

url = "https://gateway.pixazo.ai/gpt-image-2-image-to-image/v1/gpt-image-2-image-to-image/generate"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "Transform this into a Studio Ghibli style anime illustration",
    "input_images": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"]
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/gpt-image-2-image-to-image/v1/gpt-image-2-image-to-image/generate';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_API_KEY'
};
const data = {
  prompt: 'Transform this into a Studio Ghibli style anime illustration',
  input_images: ['https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.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-image-to-image/v1/gpt-image-2-image-to-image/generate" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "Transform this into a Studio Ghibli style anime illustration",
    "input_images": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"]
  }'

Output

{
  "request_id": "gpt-image-2-image-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2-image-to-image_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 - Image to Image

Parameter Required Type Default Allowed values / range Description
promptYesstringnon-emptyText description of the desired image
input_imagesYesarray of URI strings≥ 1 URL, each http:// or https://Publicly accessible reference images used to condition generation
qualityNostring"auto""low", "medium", "high", "auto"Image quality — higher = slower, more detail
backgroundNostring"auto""auto", "transparent", "opaque"Background handling. "transparent" requires output_format of png or webp
moderationNostring"auto""auto", "low"Content moderation level
aspect_ratioNostring"1:1""1:1", "3:2", "2:3"Output aspect ratio (square, landscape, portrait)
output_formatNostring"webp""png", "jpeg", "webp"Output file format
number_of_imagesNointeger11–10Number of images to generate in one request
output_compressionNointeger900–100Compression level for jpeg / webp (no effect on png)

Example Request (Full)

{
  "prompt": "Transform this into a Studio Ghibli style anime illustration",
  "input_images": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"],
  "quality": "high",
  "background": "auto",
  "moderation": "auto",
  "aspect_ratio": "3:2",
  "output_format": "png",
  "number_of_images": 2,
  "output_compression": 95
}

Response

{
  "request_id": "gpt-image-2-image-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2-image-to-image_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-image-to-image' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "gpt-image-2-image-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-2-image-to-image",
  "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-image-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "gpt-image-2-image-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-2-image-to-image",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-2-image-to-image_019dxxxx-xxxx/output.webp"
    ],
    "media_type": "image/webp"
  },
  "created_at": "2026-04-22T10:00:00.000Z",
  "updated_at": "2026-04-22T10:01:30.000Z",
  "completed_at": "2026-04-22T10:01:30.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 Image to Image (Image Editing) API Pricing

ResolutionPrice (USD)
auto$0.128
low$0.012
medium$0.047
high$0.128

GPT Image 2 Text to Image API Documentation

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

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Text to Image - GPT Image 2 Text to Image Api

Request Code

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

{
  "prompt": "A photorealistic portrait of an astronaut on Mars at golden hour"
}
import requests

url = "https://gateway.pixazo.ai/gpt-image-2-text-to-image/v1/gpt-image-2-text-to-image/generate"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "A photorealistic portrait of an astronaut on Mars at golden hour"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/gpt-image-2-text-to-image/v1/gpt-image-2-text-to-image/generate';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_API_KEY'
};
const data = {
  prompt: 'A photorealistic portrait of an astronaut on Mars at golden hour'
};

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-text-to-image/v1/gpt-image-2-text-to-image/generate" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "A photorealistic portrait of an astronaut on Mars at golden hour"
  }'

Output

{
  "request_id": "gpt-image-2-text-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2-text-to-image_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 - Text to Image

Parameter Required Type Default Allowed values / range Description
promptYesstringnon-emptyText description of the desired image
qualityNostring"auto""low", "medium", "high", "auto"Image quality — higher = slower, more detail
backgroundNostring"auto""auto", "transparent", "opaque"Background handling. "transparent" requires output_format of png or webp
moderationNostring"auto""auto", "low"Content moderation level
aspect_ratioNostring"1:1""1:1", "3:2", "2:3"Output aspect ratio (square, landscape, portrait)
output_formatNostring"webp""png", "jpeg", "webp"Output file format
number_of_imagesNointeger11–10Number of images to generate in one request
output_compressionNointeger900–100Compression level for jpeg / webp (no effect on png)

Example Request (Full)

{
  "prompt": "A photorealistic portrait of an astronaut on Mars at golden hour",
  "quality": "high",
  "background": "auto",
  "moderation": "auto",
  "aspect_ratio": "3:2",
  "output_format": "png",
  "number_of_images": 2,
  "output_compression": 95
}

Response

{
  "request_id": "gpt-image-2-text-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/gpt-image-2-text-to-image_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-text-to-image' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "gpt-image-2-text-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "gpt-image-2-text-to-image",
  "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-text-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "gpt-image-2-text-to-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "gpt-image-2-text-to-image",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-2-text-to-image_019dxxxx-xxxx/output.webp"
    ],
    "media_type": "image/webp"
  },
  "created_at": "2026-04-22T10:00:00.000Z",
  "updated_at": "2026-04-22T10:01:30.000Z",
  "completed_at": "2026-04-22T10:01:30.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 Text to Image API Pricing

ResolutionPrice (USD)
auto$0.128
low$0.012
medium$0.047
high$0.128
2. GPT Image v1.5

GPT Image v1.5 Text to Image API Documentation

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

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 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 API generate request

Parameter Required Type Description
promptYesstringA detailed text description of the desired image. The model interprets this prompt to generate visuals with high fidelity.
image_sizeOptionalstringDimensions of the generated image. Supports standard aspect ratios.
backgroundOptionalstringBackground handling mode. Use "auto" for intelligent background inference, or specify a color/texture if supported.
qualityOptionalstringRendering quality level. "high" produces more detailed outputs with longer processing. "standard" is faster but less detailed.
num_imagesOptionalintegerNumber of distinct images to generate in a single request.
output_formatOptionalstringFile format of the generated image. Supported formats: "png", "jpeg", "webp".

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 Text to Image API Pricing

No data available

Could not load current pricing