Developer Documentation
Quick Start
Get up and running with PixelPanda API in under 5 minutes
Make Your First Request
Use our simple REST API to process your first image with authentication headers
Go to Production
Scale with confidence using our reliable infrastructure and monitoring tools
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
All API requests require authentication using a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Keep your API key secure
Never expose your API key in client-side code or public repositories. Always make API calls from your backend server.
Remove Background
Remove the background from any image with stunning accuracy. Perfect for product photos, portraits, and more.
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
Enhance image resolution up to 4x while preserving quality and details. Perfect for turning low-resolution images into high-quality assets.
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
Intelligently detect and remove text from images while preserving the background. Ideal for cleaning up screenshots, removing watermarks, or preparing images for redesign.
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
Transform existing images using AI with text prompts. Perfect for style changes, color modifications, and creative transformations while preserving the original structure.
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
Generate marketing images with AI models holding or presenting your products. Perfect for e-commerce, social media ads, and product showcases.
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
Generate realistic UGC-style talking head videos from an image. Includes AI voiceover with lip-sync. Perfect for product testimonials and social media content.
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
Submit multiple product images for batch processing. Ideal for e-commerce catalogs needing marketing images at scale.
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
Check the status and results of a batch job.
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
Submit individual products for processing. Better for real-time integrations or streaming uploads.
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
Register a webhook URL to receive notifications when batches or jobs complete.
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
API rate limits vary by plan. Rate limit information is included in response headers.
| 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
Real-world examples to help you get started quickly.
Bulk Background Removal
Process an entire folder of images:
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
Complete product image processing workflow:
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
We're here to help you succeed with PixelPanda.