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 to upscale. Must be a publicly accessible URL.
upscale_modeNostringtargettarget, factorUpscale mode. "target" scales the image to a fixed megapixel resolution; "factor" multiplies each side of the image by the given factor.
targetNointeger41-8Target resolution in megapixels. Used when upscale_mode is "target".
factorNonumber21-8Scaling factor applied to each side of the image. Used when upscale_mode is "factor". Output is capped at 8 MP.
enhance_detailsNobooleanfalsetrue, falseEnhance fine textures and small details. May increase contrast and introduce minor deviations from the original image.
enhance_realismNobooleantruetrue, falseImprove realism. May deviate more from the original image. Recommended for AI-generated images.
output_formatNostringjpgwebp, jpg, pngFormat of the output image.
output_qualityNointeger800-100Quality when saving the output image, from 0 (lowest quality, smallest file) to 100 (best quality). Not relevant for PNG output.
disable_safety_checkerNobooleanfalsetrue, falseDisable the safety checker for generated images.

Content Item Types & Limits

TypeMaxFormat / SizeDescription
image1JPG, PNG, WEBPImage to upscale.

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 image edit. Describe the edit clearly; you can refer to the inputs as "image 1", "image 2", and so on.
imagesNoarray of strings (URI)[]Publicly reachable image URLs (JPG, PNG, WEBP)Images used as reference. Required for editing tasks — provide the main image as the first item. If omitted, the model generates an image from the prompt alone.
turboNobooleantruetrue, falseRuns the model faster with additional optimizations. Turn it off for complicated edit tasks to get better quality.
aspect_ratioNostringmatch_input_imagematch_input_image, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3Aspect ratio of the generated image. match_input_image matches the aspect ratio of the first input image.
seedNointegerAny integerRandom seed for reproducible generation. Reuse the same seed with identical settings to reproduce a result; leave it empty for a different output each time.
disable_safety_checkerNobooleanfalsetrue, falseDisables the safety checker for generated images.
no_opNobooleanfalsetrue, falseHealth-check mode. When true, the model returns its status without running inference (no image is generated).
webhookNostringWebhook URL for async notifications when generation completes
webhook_events_filterNoarrayEvent types to receive (e.g. ["completed"])

Content Item Types & Limits

TypeMaxFormat / SizeDescription
imageJPG, PNG, WEBPReference image(s).

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.

⚡ Performance

Live usage measured on Pixazo's gateway, split by model version. Generation time is how long a generation takes end-to-end (lower is better). Success rate is the percent of generations that complete (higher is better).

Show data for the last
Generations
3,600last 30d
~120 per day
Success rate
94.4%
of completed generations
Generation time
39.0savg
p95 59.1s
Requests
Jul 8max 600Aug 6
P Image v1Avg 83/day
P Image UpscaleAvg 37/day
Generation Time
Jul 8max 97.7sAug 6
P Image v1Avg 21.5s
P Image UpscaleAvg 79.9s
Error Rate
Jul 8max 100.0%Aug 6
P Image v1Avg 4.3%
P Image UpscaleAvg 9.1%

〰 Uptime

Percent of generations that succeeded over the selected period, per model version.

Avg. Success Rate (30d)
94.44%
across all generations of this model family
Uptime
Jul 8max 100%Aug 6
P Image v1Avg 95.65%
P Image UpscaleAvg 90.91%