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
}
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.