Complete Guide to PixelAPI: 11 AI Models, One API Key
PixelAPI packs 10 AI models into a single REST API. One API key, predictable credit-based pricing, no cold starts. This guide covers every model with working code examples.
Quick Reference: All 11 Models
| # | Model | Endpoint | Credits | Cost | Speed |
|---|---|---|---|---|---|
| 1 | FLUX Schnell | POST /v1/image/generate | 3 | $0.003 | ~3s |
| 2 | SDXL | POST /v1/image/generate | 3 | $0.003 | ~13s |
| 3 | SDXL img2img | POST /v1/image/img2img | 3 | $0.003 | ~6s |
| 4 | SDXL Inpainting | POST /v1/image/inpaint | 5 | $0.005 | ~10s |
| 5 | ControlNet Canny | POST /v1/image/controlnet | 5 | $0.005 | ~13s |
| 6 | Background Removal | POST /v1/edit/remove-background | 2 | $0.002 | ~3s |
| 7 | Background Replacement | POST /v1/edit/replace-background | 5 | $0.005 | ~10s |
| 8 | Real-ESRGAN 4x Upscale | POST /v1/edit/upscale | 20 | $0.02 | ~3s |
| 9 | Face Restore (GFPGAN) | POST /v1/edit/restore-face | 3 | $0.003 | ~11s |
| 10 | Object Removal (LaMa) | POST /v1/edit/remove-object | 5 | $0.005 | ~4s |
| 11 | MusicGen | POST /v1/audio/generate | 5 | $0.005 | ~10s |
Setup
Sign up at pixelapi.dev/app with Google. You get 100 free credits instantly — no credit card needed.
import requests
API_KEY = "your_api_key_here"
BASE = "https://api.pixelapi.dev"
headers = {"Authorization": f"Bearer {API_KEY}"}
1. FLUX Schnell — Fast Photorealistic Generation
FLUX Schnell by Black Forest Labs generates photorealistic images in ~3 seconds. Best for quick iterations when you need realistic outputs fast.
response = requests.post(f"{BASE}/v1/image/generate",
headers=headers,
json={
"prompt": "professional product photo of white sneakers on marble surface, studio lighting",
"model": "flux-schnell",
"width": 1024,
"height": 1024
})
print(response.json()["output_url"])
Best for: Product mockups, photorealistic scenes, quick prototyping.
Cost: 3 credits ($0.003) · Speed: ~3 seconds
2. SDXL — Versatile Text-to-Image
Stable Diffusion XL is the workhorse. Supports negative prompts and fine-grained control. Takes longer than FLUX but offers more creative flexibility.
response = requests.post(f"{BASE}/v1/image/generate",
headers=headers,
json={
"prompt": "minimalist flat lay of a leather wallet, white background, editorial style",
"model": "sdxl",
"negative_prompt": "blurry, low quality, distorted",
"width": 1024,
"height": 1024,
"guidance_scale": 7.5
})
Best for: Illustrations, creative work, when you need negative prompts.
Cost: 3 credits ($0.003) · Speed: ~13 seconds
3. SDXL img2img — Transform Existing Images
Take an existing image and transform it with a text prompt. The strength parameter (0.0–1.0) controls how much the output differs from the input.
response = requests.post(f"{BASE}/v1/image/img2img",
headers=headers,
files={"image": open("product.jpg", "rb")},
data={
"prompt": "watercolor painting style, artistic",
"strength": "0.6",
"negative_prompt": "blurry"
})
Best for: Style transfer, product variations, artistic effects.
Cost: 3 credits ($0.003) · Speed: ~6 seconds
4. SDXL Inpainting — Edit Specific Regions
Provide an image and a mask — the masked area gets filled with AI-generated content matching your prompt.
response = requests.post(f"{BASE}/v1/image/inpaint",
headers=headers,
files={
"image": open("room.jpg", "rb"),
"mask": open("mask.png", "rb")
},
data={"prompt": "a modern floor lamp, minimalist design"})
Best for: Product placement, filling gaps, replacing specific objects.
Cost: 5 credits ($0.005) · Speed: ~10 seconds
5. ControlNet Canny — Edge-Guided Generation
Upload a reference image. ControlNet extracts the edge structure and generates a new image that follows the same composition.
response = requests.post(f"{BASE}/v1/image/controlnet",
headers=headers,
files={"image": open("sketch.jpg", "rb")},
data={"prompt": "luxury perfume bottle, glass, studio photography"})
Best for: Maintaining composition while changing style, sketch-to-photo.
Cost: 5 credits ($0.005) · Speed: ~13 seconds
6. Background Removal (BiRefNet)
Upload an image, get back a transparent PNG with the background removed. Uses BiRefNet, the current state-of-the-art segmentation model.
response = requests.post(f"{BASE}/v1/edit/remove-background",
headers=headers,
files={"image": open("product.jpg", "rb")})
# Returns transparent PNG
print(response.json()["output_url"])
Best for: E-commerce catalogs, product listings, clean cutouts.
Cost: 2 credits ($0.002) · Speed: ~3 seconds
7. Background Replacement
Removes the background and replaces it with an AI-generated scene from your text prompt, or a solid color.
# AI-generated background
response = requests.post(f"{BASE}/v1/edit/replace-background",
headers=headers,
files={"image": open("product.jpg", "rb")},
data={"prompt": "on a wooden table in a sunlit kitchen, warm tones"})
# Solid color background
response = requests.post(f"{BASE}/v1/edit/replace-background",
headers=headers,
files={"image": open("product.jpg", "rb")},
data={"background_color": "#F5F5F5"})
Best for: Lifestyle product photos, consistent catalog backgrounds.
Cost: 5 credits ($0.005) · Speed: ~10 seconds
8. Real-ESRGAN 4x Upscale
Upscale images to 4x their original resolution using Real-ESRGAN. Turns 256×256 into 1024×1024 with AI-enhanced detail.
response = requests.post(f"{BASE}/v1/edit/upscale",
headers=headers,
files={"image": open("thumbnail.jpg", "rb")})
Best for: Enhancing thumbnails for print, upscaling old/low-res images.
Cost: 20 credits ($0.02) · Speed: ~3 seconds
9. Face Restore (GFPGAN)
Enhance and restore faces in photos. Fixes blurry, compressed, or old photos with face detail enhancement.
response = requests.post(f"{BASE}/v1/edit/restore-face",
headers=headers,
files={"image": open("old_photo.jpg", "rb")})
Best for: Old photo restoration, face enhancement in low-quality images.
Cost: 3 credits ($0.003) · Speed: ~11 seconds
10. Object Removal (LaMa)
Remove unwanted objects from images. Provide the image and a mask indicating what to remove — LaMa fills the area naturally.
response = requests.post(f"{BASE}/v1/edit/remove-object",
headers=headers,
files={
"image": open("photo.jpg", "rb"),
"mask": open("mask.png", "rb")
})
Best for: Cleaning up product photos, removing watermarks, removing distractions.
Cost: 5 credits ($0.005) · Speed: ~4 seconds
11. MusicGen — AI Audio Generation
Generate music and audio clips from text descriptions using Meta's MusicGen model.
response = requests.post(f"{BASE}/v1/audio/generate",
headers=headers,
json={
"prompt": "upbeat lo-fi hip hop beat, chill vibes, coffee shop",
"duration": 10
})
print(response.json()["output_url"]) # Audio file URL
Best for: Product video background music, app sound design, content creation.
Cost: 5 credits ($0.005) · Speed: ~10 seconds
Pricing
| Plan | Price | Credits | Images (at 3 credits each) |
|---|---|---|---|
| Free | $0 | 100 | ~33 |
| Starter | $10/mo | 10,000 | ~3,333 |
| Pro | $50/mo | 60,000 | ~20,000 |
| Scale | $200/mo | 300,000 | ~100,000 |
India pricing (Razorpay): ₹200/2K credits · ₹1,000/12K credits · ₹5,000/75K credits
Get Started
100 free credits on signup. No credit card required. Sign up here →
Full API documentation: pixelapi.dev/docs