Pixazo APIModelsP Image
Pixazo APIModelsP Image

P-Image API - AI Image Editing & Transformation APIs

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

LIMITED TIME OFFER

Get $5 Free Credit on First Payment

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

Claim Your $5 →

P Image Upscale Image to Image (Image Upscaler) API Documentation

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

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 generate request to receive a POST callback instead of polling.

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

Request Parameters - P Image Upscale Request

Parameter Required Type Description
imageYesstring (URI)Input image URL to upscale. Must be publicly accessible.
upscale_modeNostringUpscale mode: "target" (scales to fixed megapixel resolution) or "factor" (multiplies each side by factor). Default: "target".
targetNointegerTarget resolution in megapixels (1-8). Used when upscale_mode is "target". Default: 4.
factorNonumberScaling factor applied to each side (1-8). Used when upscale_mode is "factor". Output capped at 8 MP. Default: 2.
enhance_detailsNobooleanEnhance fine textures and small details. May increase contrast. Default: false.
enhance_realismNobooleanImprove realism. Recommended for AI-generated images. Default: true.
output_formatNostringOutput format: "webp", "jpg", or "png". Default: "jpg".
output_qualityNointegerOutput quality (0-100). 100 is best. Not relevant for PNG. Default: 80.
disable_safety_checkerNobooleanDisable 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 Image to Image (Image Upscaler) API Pricing

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

P Image v1 Image to Image (Image Editing) API Documentation

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

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 generate request to receive a POST callback instead of polling.

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

Request Parameters - Image Request

Field Type Required Default Description
prompt string Yes Text prompt describing the desired image edit. You can refer to images as "image 1", "image 2", etc.
images array of strings (URI) Yes Input image URLs. For editing tasks, provide the main image as the first image
turbo boolean No true Faster generation with additional optimizations. Turn off for complicated tasks
seed integer No Random seed for reproducible generation
aspect_ratio string No "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_checker boolean No false Disable safety checker for generated images
webhook string No Webhook URL for async notifications when generation completes
webhook_events_filter array No Event 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 Image to Image (Image Editing) API Pricing

ResolutionPrice (USD)
All Resolution$0.01