Pixazo APIModelsP Image
Pixazo APIModelsP Image

P-Image API: Pricing, Documentation

by Pruna AI

P Image by Pruna AI provides advanced AI-powered image editing and transformation capabilities. Through Pixazo's API, developers can integrate intelligent image editing features that enable precise modifications, creative transformations, and image-to-image generation. The API supports versatile editing workflows for content creators, designers, and developers seeking high-quality AI image processing.

Get API Key
P 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 →

P Image Upscale API Documentation

https://gateway.pixazo.ai/p-image-upscale/v1/p-image-upscale/generate

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

P Image Upscale Request - P Image Upscale API

Request Code

POST https://gateway.pixazo.ai/p-image-upscale/v1/p-image-upscale/generate
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"
}
import requests

url = "https://gateway.pixazo.ai/p-image-upscale/v1/p-image-upscale/generate"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/p-image-upscale/v1/p-image-upscale/generate';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
  image: '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/p-image-upscale/v1/p-image-upscale/generate" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"
  }'

Output

{
  "request_id": "p-image-upscale_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/p-image-upscale_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": "p-image-upscale_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "p-image-upscale",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/p-image-upscale_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.jpg"
    ],
    "media_type": "image/jpeg"
  },
  "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": "p-image-upscale_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "p-image-upscale",
  "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 - P Image Upscale Request

ParameterRequiredTypeDefaultAllowed values / rangeDescription
imageYesstring (URI)Input image URL to upscale. Must be publicly accessible.
upscale_modeNostringtargetUpscale mode: "target" (scales to fixed megapixel resolution) or "factor" (multiplies each side by factor). Default: "target".
targetNointeger4Target resolution in megapixels (1-8). Used when upscale_mode is "target". Default: 4.
factorNonumber2Scaling factor applied to each side (1-8). Used when upscale_mode is "factor". Output capped at 8 MP. Default: 2.
enhance_detailsNobooleanfalsetrue, falseEnhance fine textures and small details. May increase contrast. Default: false.
enhance_realismNobooleantruetrue, falseImprove realism. Recommended for AI-generated images. Default: true.
output_formatNostringjpgOutput format: "webp", "jpg", or "png". Default: "jpg".
output_qualityNointeger80Output quality (0-100). 100 is best. Not relevant for PNG. Default: 80.
disable_safety_checkerNobooleanfalsetrue, falseDisable safety checker. Default: false.

Example Request

{
  "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png",
  "upscale_mode": "target",
  "target": 4,
  "enhance_details": true,
  "enhance_realism": true,
  "output_format": "jpg",
  "output_quality": 90
}

Response

{
  "request_id": "p-image-upscale_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/p-image-upscale_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. Required: $0.01"
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'p-image-upscale' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "p-image-upscale_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "p-image-upscale",
  "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/p-image-upscale_019d5176-9030-7fba-9adc-4952048aa80bf"

Response (Completed)

{
  "request_id": "p-image-upscale_019d5176-9030-7fba-9adc-4952048aa80bf",
  "status": "COMPLETED",
  "model_id": "p-image-upscale",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/p-image-upscale_019d5176-9030-7fba-9adc-4952048aa80bf/output.jpg"
    ],
    "media_type": "image/jpeg"
  },
  "created_at": "2026-03-31T07:32:03.749Z",
  "updated_at": "2026-03-31T07:32:20.000Z",
  "completed_at": "2026-03-31T07:32:20.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 (image/jpeg)
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.

P Image Upscale API Pricing

ResolutionPrice (USD)
1-4MP$0.005
4-8MP$0.01
2. P Image v1

P Image v1 API Documentation

https://gateway.pixazo.ai/p-image/v1/p-image-edit/generate

Authentication

All requests require an API key passed via header.

Header Type Required Description
Ocp-Apim-Subscription-Key string Yes Your API subscription key

Image Request - P Image

Request Code

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

{
  "prompt": "The woman dress is changed to black",
  "images": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"
  ]
}
import requests

url = "https://gateway.pixazo.ai/p-image/v1/p-image-edit/generate"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "The woman dress is changed to black",
    "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/p-image/v1/p-image-edit/generate';

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    prompt: 'The woman dress is changed to black',
    images: ['https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png']
  })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/p-image/v1/p-image-edit/generate" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "The woman dress is changed to black",
    "images": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"]
  }'

Output

{
  "request_id": "p-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/p-image_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": "p-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "p-image",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/p-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.jpg"
    ],
    "media_type": "image/jpeg"
  },
  "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": "p-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "p-image",
  "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 Request

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringText prompt describing the desired image edit. You can refer to images as "image 1", "image 2", etc.
imagesYesarray of strings (URI)Input image URLs. For editing tasks, provide the main image as the first image
turboNobooleantruetrue, falseFaster generation with additional optimizations. Turn off for complicated tasks
seedNointegerRandom seed for reproducible generation
aspect_ratioNostring"match_input_image"Aspect ratio for the generated image. Valid values: "match_input_image", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"
disable_safety_checkerNobooleanfalsetrue, falseDisable safety checker for generated images
webhookNostringWebhook URL for async notifications when generation completes
webhook_events_filterNoarrayEvent types to receive (e.g. ["completed"])

Minimum Request

{
  "prompt": "The woman dress is changed to black",
  "images": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"
  ]
}

Full Request (all options)

{
  "prompt": "The woman dress is changed to black",
  "images": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/f1.png"
  ],
  "turbo": true,
  "seed": 42,
  "aspect_ratio": "1:1",
  "disable_safety_checker": false,
  "webhook": "https://your-webhook.com/callback",
  "webhook_events_filter": [
    "completed"
  ]
}

Response

{
  "request_id": "p-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/p-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Type application/json
Cache-Control no-cache
Ocp-Apim-Subscription-Key Your API subscription key

Response Handling

Common status codes for Image Request.

Code Meaning
202 Accepted — Request queued
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal 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. Required: $0.01"
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'p-image' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "p-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "p-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/p-image_019d42ce-8064-789e-5840-890db47729647"

Response (Completed)

{
  "request_id": "p-image_019d42ce-8064-789e-5840-890db47729647",
  "status": "COMPLETED",
  "model_id": "p-image",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/p-image_019d42ce-8064-789e-5840-890db47729647/output.jpg"
    ],
    "media_type": "image/jpeg"
  },
  "created_at": "2026-03-31T07:32:03.749Z",
  "updated_at": "2026-03-31T07:32:20.000Z",
  "completed_at": "2026-03-31T07:32:20.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 (image/jpeg)
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.

P Image v1 API Pricing

Your request will cost $0.01 per image.