Developer Documentation
Quick Start
Three steps and you're live. Most developers have their first API call working in about five minutes.
Get Your API Key
Create a free account, then grab your key from the dashboard. No credit card needed.
Make Your First Request
Send a multipart POST with your image and an Authorization header. That's it — you'll get back a processed image URL.
Go to Production
When you're ready, upgrade your plan for higher rate limits and batch processing. Same API, no code changes.
Your First API Call
curl -X POST https://pixelpanda.ai/api/process \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/image.jpg" \
-F "processing_type=background_removal"
Authentication
Every request needs a Bearer token in the Authorization header. You'll find your token in the dashboard after signing up.
Authorization: Bearer YOUR_API_KEY
Keep your API key secret
Don't put your key in frontend code or commit it to Git. Make API calls from your server, not from the browser.
Remove Background
Strips the background from photos and returns a transparent PNG. Works well on product shots, headshots, and complex edges like hair.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| image | file | Required | The image file to process (JPEG, PNG, max 10MB) |
| processing_type | string | Required | Set to "background_removal" |
| output_format | string | Optional | Output format: "png" (default) or "webp" |
| quality | integer | Optional | Output quality (1-100, default: 95) |
Example Request
curl -X POST https://pixelpanda.ai/api/process \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/image.jpg" \
-F "processing_type=background_removal"
Response
{
"success": true,
"processing_id": "550e8400-e29b-41d4-a716-446655440000",
"result_url": "https://pixelpanda.ai/results/550e8400.png",
"credits_used": 1,
"credits_remaining": 49,
"processing_time": 1.23,
"metadata": {
"original_size": [1920, 1080],
"result_size": [1920, 1080],
"format": "png"
}
}
{
"success": false,
"error": "Invalid image format",
"error_code": "INVALID_FORMAT",
"details": "Supported formats: JPEG, PNG"
}
Upscale Image
Bumps image resolution up to 4x using Real-ESRGAN. Handy when you've got a low-res product photo that needs to look sharp on a retina display.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image |
file | Yes | Image file to upscale (JPEG, PNG) |
processing_type |
string | Yes | Set to "upscale" |
scale |
integer | No | Upscale factor (2 or 4, default: 2) |
face_enhance |
boolean | No | Enhance faces in the image (default: false) |
Example Request
curl -X POST https://pixelpanda.ai/api/process \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/image.jpg" \
-F "processing_type=upscale" \
-F "scale=4"
Remove Text
Finds text in the image (watermarks, captions, overlay graphics) and paints it out, filling in the background behind it. Useful for cleaning up stock photos or stripping watermarks before redesigning.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image |
file | Yes | Image file containing text to remove |
processing_type |
string | Yes | Set to "text_removal" |
Example Request
curl -X POST https://pixelpanda.ai/api/process \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/image.jpg" \
-F "processing_type=text_removal"
Image-to-Image Transformation
Give the API an image plus a text prompt and it'll transform the image accordingly — change the color palette, swap the setting, add a seasonal vibe, whatever you describe. The original composition stays intact.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | Yes | Input image file (JPEG/PNG, max 10MB) |
processing_type |
string | Yes | Must be "image_to_image" |
parameters |
JSON string | Yes | JSON object with "prompt" and optional "strength" (0-1) |
Example Request
curl -X POST https://pixelpanda.ai/api/process \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@image.jpg" \
-F "processing_type=image_to_image" \
-F 'parameters={"prompt":"make it a sunset scene","strength":0.75}'
Example Response
{
"processing_id": "abc123",
"status": "completed",
"processing_type": "image_to_image",
"result_image_url": "data:image/png;base64,...",
"processing_time": 8.2,
"credits_used": 2
}
Generate Product Marketing Images
Upload a product photo and pick one of our AI models — you'll get back a realistic image of the model holding or wearing your product. Great for building out your product listing gallery without a photoshoot.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
product_image |
file | Yes | Product image file (JPEG/PNG) |
model_id |
string | Yes | AI model ID (e.g., "model_002", "model_051") |
prompt |
string | No | Custom prompt for the scene |
Example Request
curl -X POST https://pixelpanda.ai/api/tryon/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "product_image=@product.jpg" \
-F "model_id=model_002" \
-F "prompt=Model holding the product with a smile"
Example Response
{
"success": true,
"result_url": "https://pixelpanda.ai/results/abc123.png",
"credits_used": 1
}
Generate UGC Videos
Turn a still avatar image into a talking-head video. You provide the script text, and we generate the voiceover, animate the face, and lip-sync everything together. The output looks like a real person talking to camera — the kind of UGC clip you'd see on TikTok or Instagram Reels.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image_url |
string | Yes | URL of the avatar/model image |
script |
string | Yes | Text for the voiceover (max 150 words) |
prompt |
string | No | Motion/action description |
enable_subtitles |
boolean | No | Add TikTok-style captions (default: false) |
Pricing
Credits scale with video length: 5 credits per 10 seconds (minimum 5 credits)
Example Request
curl -X POST https://pixelpanda.ai/api/tryon/quick-video \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image_url=https://example.com/avatar.png" \
-F "script=Hey everyone! I just tried this amazing product..." \
-F "enable_subtitles=true"
Example Response
{
"success": true,
"video_url": "https://pixelpanda.ai/videos/abc123.mp4",
"duration_seconds": 8,
"credits_used": 5
}
Submit Batch Job
Got a whole catalog to process? Send up to 100 product images in one request. We'll generate marketing photos for each one in the background and hit your webhook when the batch is done.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
images |
array | Yes | Array of image objects (max 100) |
images[].id |
string | Yes | Your unique ID (SKU, product ID) |
images[].image |
string | Yes | Base64-encoded image data |
images[].category |
string | No | Product category (clothing, electronics, etc.) |
images_per_product |
integer | No | Number of images per product (default: 6) |
webhook_url |
string | No | URL to receive completion notification |
Example Request
curl -X POST https://pixelpanda.ai/api/v2/batches \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"images": [
{"id": "sku-001", "image": "base64...", "category": "clothing"},
{"id": "sku-002", "image": "base64...", "category": "clothing"}
],
"images_per_product": 6,
"webhook_url": "https://yoursite.com/webhook"
}'
Example Response
{
"batch_id": "batch_abc123",
"status": "pending",
"total_images": 2,
"credits_reserved": 12
}
Get Batch Status
Poll this endpoint to see how your batch is progressing. Once all images are done (or if something fails), you'll see the full results here.
Example Response
{
"batch_id": "batch_abc123",
"status": "completed",
"progress": {
"completed": 2,
"failed": 0,
"pending": 0
},
"images": [
{
"id": "sku-001",
"status": "completed",
"results": [
{"scene": "Model Wearing", "url": "https://..."},
{"scene": "Lifestyle", "url": "https://..."}
]
}
]
}
Single-Item Jobs
If you're processing products one at a time (say, as they get uploaded to your store), use Jobs instead of Batches. Same output, but designed for real-time workflows where you don't want to wait and collect a batch first.
Request Body (JSON)
| Parameter | Type | Required | Description |
|---|---|---|---|
product_image |
string | Yes | Base64-encoded product image |
category |
string | No | Product category |
images_to_generate |
integer | No | Number of images (default: 6) |
webhook_url |
string | No | Completion notification URL |
Check Job Status
{
"job_id": "job_abc123",
"status": "completed",
"results": [
{"scene": "Model Wearing", "url": "https://..."},
{"scene": "Flat Lay", "url": "https://..."}
],
"credits_used": 6
}
Webhooks
Instead of polling for results, register a webhook and we'll POST to your URL when a batch or job finishes. Saves you from having to check back every few seconds.
Register Webhook
curl -X POST https://pixelpanda.ai/api/v2/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://yoursite.com/webhook"}'
Webhook Payload
{
"event": "batch.completed",
"batch_id": "batch_abc123",
"status": "completed",
"timestamp": "2024-01-15T10:30:00Z"
}
Manage Webhooks
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v2/webhooks |
List all webhooks |
| DELETE | /api/v2/webhooks/{id} |
Remove a webhook |
Rate Limits
Each plan has different rate limits. We include the current counts in response headers so you can track usage on your end.
| Plan | Requests/Minute | Requests/Day | Max File Size |
|---|---|---|---|
| Free | 10 | 50 | 5 MB |
| Starter | 60 | 5,000 | 10 MB |
| Pro | 300 | 50,000 | 25 MB |
| Enterprise | Custom | Unlimited | 100 MB |
Rate Limit Headers
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1640995200
Code Examples
Copy-paste these into your project and swap in your API key. Both examples are production-ready patterns we've seen work well.
Bulk Background Removal
Loop through a folder and remove backgrounds from every image in it:
import requests
import os
from pathlib import Path
API_KEY = "YOUR_API_KEY"
API_URL = "https://pixelpanda.ai/api/process"
# Process all images in a directory
input_dir = Path("./input_images")
output_dir = Path("./output_images")
output_dir.mkdir(exist_ok=True)
for image_path in input_dir.glob("*.jpg"):
with open(image_path, 'rb') as f:
response = requests.post(
API_URL,
headers={"Authorization": f"Bearer {API_KEY}"},
files={"image": f},
data={"processing_type": "background_removal"}
)
result = response.json()
if result.get("success"):
# Download the result image
result_url = result["result_url"]
output_path = output_dir / f"{image_path.stem}_nobg.png"
img_data = requests.get(result_url).content
with open(output_path, 'wb') as f:
f.write(img_data)
print(f"Processed: {image_path.name}")
E-commerce Product Pipeline
Remove the background, then upscale the result — a common two-step combo for product listings:
const API_KEY = 'YOUR_API_KEY';
const API_URL = 'https://pixelpanda.ai/api/process';
async function processProductImage(imagePath) {
// 1. Remove background
const bgFormData = new FormData();
bgFormData.append('image', await fetch(imagePath).then(r => r.blob()));
bgFormData.append('processing_type', 'background_removal');
const bgResponse = await fetch(API_URL, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}` },
body: bgFormData
});
const noBgResult = await bgResponse.json();
// 2. Upscale for high-quality display
const upscaleFormData = new FormData();
upscaleFormData.append('image', await fetch(noBgResult.result_url).then(r => r.blob()));
upscaleFormData.append('processing_type', 'upscale');
upscaleFormData.append('scale', '2');
const upscaleResponse = await fetch(API_URL, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}` },
body: upscaleFormData
});
const upscaled = await upscaleResponse.json();
return {
original: noBgResult.result_url,
upscaled: upscaled.result_url
};
}
Support
Stuck on something? Here's how to get help.
Documentation
You're looking at it — all endpoints, parameters, and examples are on this page
View Docs