← Back to Blog

Complete Guide to PixelAPI: 11 AI Models, One API Key

Published February 25, 2026 · 15 min read

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

#ModelEndpointCreditsCostSpeed
1FLUX SchnellPOST /v1/image/generate3$0.003~3s
2SDXLPOST /v1/image/generate3$0.003~13s
3SDXL img2imgPOST /v1/image/img2img3$0.003~6s
4SDXL InpaintingPOST /v1/image/inpaint5$0.005~10s
5ControlNet CannyPOST /v1/image/controlnet5$0.005~13s
6Background RemovalPOST /v1/edit/remove-background2$0.002~3s
7Background ReplacementPOST /v1/edit/replace-background5$0.005~10s
8Real-ESRGAN 4x UpscalePOST /v1/edit/upscale20$0.02~3s
9Face Restore (GFPGAN)POST /v1/edit/restore-face3$0.003~11s
10Object Removal (LaMa)POST /v1/edit/remove-object5$0.005~4s
11MusicGenPOST /v1/audio/generate5$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

PlanPriceCreditsImages (at 3 credits each)
Free$0100~33
Starter$10/mo10,000~3,333
Pro$50/mo60,000~20,000
Scale$200/mo300,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