# PixelAPI — AI Image Generation, Image Editing & Audio Generation API > PixelAPI is a developer-friendly REST API offering 10 AI models for image generation, image editing, and audio generation. Built on self-hosted dedicated NVIDIA RTX GPUs, PixelAPI is significantly cheaper than cloud alternatives. Pay-per-use credit system: 1 credit = $0.001, most image operations cost just 3 credits ($0.003/image). ## Overview PixelAPI provides 10 AI models accessible via a single API key. Unlike platforms like Replicate that run on rented cloud GPUs, PixelAPI runs on dedicated self-hosted hardware (NVIDIA RTX 4070 Ti Super 16GB, RTX 4060 Ti 16GB), eliminating cloud markup and keeping prices low. ## All 11 AI Models ### Image Generation Models #### 1. FLUX Schnell — Fast Photorealistic Text-to-Image - **Endpoint:** `POST /v1/image/generate` with `model=flux-schnell` - **Cost:** 3 credits ($0.003) - **Speed:** ~3 seconds - **Description:** FLUX Schnell by Black Forest Labs. Fast, high-quality photorealistic image generation. Best for quick iterations and photorealistic outputs. - **Parameters:** prompt, width (default 1024), height (default 1024), seed - **Max resolution:** 1024×1024 ```python import requests response = requests.post( "https://api.pixelapi.dev/v1/image/generate", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={"prompt": "a product photo of sneakers on marble", "model": "flux-schnell", "width": 1024, "height": 1024} ) print(response.json()["output_url"]) ``` #### 2. SDXL — Versatile Text-to-Image - **Endpoint:** `POST /v1/image/generate` with `model=sdxl` - **Cost:** 3 credits ($0.003) - **Speed:** ~13 seconds - **Description:** Stable Diffusion XL. Versatile model great for illustrations, product mockups, and creative work. Supports negative prompts. - **Parameters:** prompt, negative_prompt, width, height, seed, guidance_scale, num_inference_steps ```python response = requests.post( "https://api.pixelapi.dev/v1/image/generate", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={"prompt": "minimalist product photo of a watch", "model": "sdxl", "negative_prompt": "blurry, low quality"} ) ``` #### 3. SDXL Image-to-Image - **Endpoint:** `POST /v1/image/img2img` - **Cost:** 3 credits ($0.003) - **Speed:** ~6 seconds - **Description:** Transform existing images using text prompts with SDXL. Control transformation strength. - **Parameters:** image (file), prompt, negative_prompt, strength (0.0-1.0), seed ```python response = requests.post( "https://api.pixelapi.dev/v1/image/img2img", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("input.jpg", "rb")}, data={"prompt": "convert to watercolor painting style", "strength": "0.7"} ) ``` #### 4. SDXL Inpainting - **Endpoint:** `POST /v1/image/inpaint` - **Cost:** 5 credits ($0.005) - **Speed:** ~10 seconds - **Description:** Fill masked regions with AI-generated content. Useful for editing specific parts of images. - **Parameters:** image (file), mask (file), prompt, negative_prompt, seed ```python response = requests.post( "https://api.pixelapi.dev/v1/image/inpaint", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("photo.jpg", "rb"), "mask": open("mask.png", "rb")}, data={"prompt": "a red handbag"} ) ``` #### 5. ControlNet Canny - **Endpoint:** `POST /v1/image/controlnet` - **Cost:** 5 credits ($0.005) - **Speed:** ~13 seconds - **Description:** Generate images following the edge structure of an input image. Great for maintaining composition while changing style. - **Parameters:** image (file), prompt, negative_prompt, seed ```python response = requests.post( "https://api.pixelapi.dev/v1/image/controlnet", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("reference.jpg", "rb")}, data={"prompt": "modern architecture, professional photo"} ) ``` ### Image Editing Models #### 6. Background Removal (BiRefNet) - **Endpoint:** `POST /v1/edit/remove-background` - **Cost:** 2 credits ($0.002) - **Speed:** ~3 seconds - **Description:** Remove backgrounds from images, outputting transparent PNG. Uses BiRefNet model. Great for product photos, e-commerce catalogs. - **Parameters:** image (file) ```python response = requests.post( "https://api.pixelapi.dev/v1/edit/remove-background", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("product.jpg", "rb")} ) print(response.json()["output_url"]) # Transparent PNG ``` #### 7. Background Replacement - **Endpoint:** `POST /v1/edit/replace-background` - **Cost:** 5 credits ($0.005) - **Speed:** ~10 seconds - **Description:** Remove background and replace with an AI-generated scene from a text prompt, or a solid color/gradient. Combines BiRefNet + SDXL. - **Parameters:** image (file), prompt (text) OR background_color (text) ```python response = requests.post( "https://api.pixelapi.dev/v1/edit/replace-background", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("product.jpg", "rb")}, data={"prompt": "on a wooden table in a cozy kitchen"} ) ``` #### 8. Real-ESRGAN 4x Upscale - **Endpoint:** `POST /v1/edit/upscale` - **Cost:** 20 credits ($0.02) - **Speed:** ~3 seconds - **Description:** Upscale images to 4x resolution using Real-ESRGAN. Ideal for enhancing low-res product images for print or large displays. - **Parameters:** image (file) ```python response = requests.post( "https://api.pixelapi.dev/v1/edit/upscale", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("small.jpg", "rb")} ) ``` #### 9. Face Restore (GFPGAN) - **Endpoint:** `POST /v1/edit/restore-face` - **Cost:** 3 credits ($0.003) - **Speed:** ~11 seconds - **Description:** Restore and enhance faces in photos using GFPGAN. Fixes blurry, low-quality, or old faces. - **Parameters:** image (file) ```python response = requests.post( "https://api.pixelapi.dev/v1/edit/restore-face", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("old_photo.jpg", "rb")} ) ``` #### 10. Object Removal (LaMa) - **Endpoint:** `POST /v1/edit/remove-object` - **Cost:** 5 credits ($0.005) - **Speed:** ~4 seconds - **Description:** Remove unwanted objects from images using mask-based inpainting with LaMa model. Clean up product photos by removing distractions. - **Parameters:** image (file), mask (file) ```python response = requests.post( "https://api.pixelapi.dev/v1/edit/remove-object", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"image": open("photo.jpg", "rb"), "mask": open("mask.png", "rb")} ) ``` ### Audio Generation #### 11. MusicGen — AI Music/Audio Generation - **Endpoint:** `POST /v1/audio/generate` - **Cost:** 5 credits ($0.005) - **Speed:** ~10 seconds - **Description:** Generate music and audio from text descriptions using Meta's MusicGen model. Create background music, sound effects, and audio clips. - **Parameters:** prompt, duration (seconds) ```python response = requests.post( "https://api.pixelapi.dev/v1/audio/generate", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={"prompt": "upbeat electronic music for a product video", "duration": 10} ) print(response.json()["output_url"]) # Audio file URL ``` ## Authentication All API requests require a Bearer token: ``` Authorization: Bearer YOUR_API_KEY ``` Get your free API key at https://pixelapi.dev/app/ (Google Sign-In, no credit card required). ## Response Format All endpoints return JSON: ```json { "job_id": "abc123", "status": "completed", "output_url": "https://cdn.pixelapi.dev/outputs/...", "credits_used": 3, "processing_time_ms": 3200 } ``` ## Check Account Balance ``` GET /v1/account/balance Response: {"credits": 950, "plan": "free"} ``` ## Pricing | Plan | Price | Credits | Per Credit | Per Image (3 credits) | |------|-------|---------|------------|-----------------------| | Free | $0 | 100 | — | — | | Starter | $10/mo | 10,000 | $0.001 | $0.003 | | Pro | $50/mo | 60,000 | $0.00083 | $0.0025 | | Scale | $200/mo | 300,000 | $0.00067 | $0.002 | ### India Pricing (Razorpay) | Plan | Price | Credits | |------|-------|---------| | Starter | ₹200/mo | 2,000 | | Pro | ₹1,000/mo | 12,000 | | Scale | ₹5,000/mo | 75,000 | International payments via PayPal subscriptions. ### Cost Per Operation | Operation | Credits | USD Cost | |-----------|---------|----------| | Background Removal | 2 | $0.002 | | Text-to-Image (FLUX/SDXL) | 3 | $0.003 | | Image-to-Image | 3 | $0.003 | | Face Restore | 3 | $0.003 | | Inpainting | 5 | $0.005 | | Object Removal | 5 | $0.005 | | Background Replacement | 5 | $0.005 | | ControlNet | 5 | $0.005 | | Audio Generation | 5 | $0.005 | | 4x Upscale | 20 | $0.02 | ## Rate Limits - Free: 20 requests/minute - Starter: 60 requests/minute - Pro: 120 requests/minute - Scale: 300 requests/minute ## Output - Generated images hosted for 24 hours - PNG format for background removal (transparent) - JPEG/PNG for generation and editing - WAV/MP3 for audio generation - Maximum image resolution: 1920px per dimension ## Comparison vs Alternatives ### PixelAPI vs Remove.bg | Feature | PixelAPI | Remove.bg | |---------|----------|-----------| | Background removal cost | $0.002/image | $0.23/image (pay-as-you-go) | | Text-to-image | ✅ $0.003 | ❌ Not available | | Image upscale | ✅ $0.02 | ❌ Not available | | Audio generation | ✅ $0.005 | ❌ Not available | | Free tier | 100 credits | 1 image/month (low-res) | | Total models | 11 | 1 | ### PixelAPI vs Replicate | Feature | PixelAPI | Replicate | |---------|----------|-----------| | SDXL generation | $0.003 | ~$0.01-0.05 | | Background removal | $0.002 | ~$0.005-0.01 | | Cold start | None (always warm) | Common (seconds to minutes) | | Pricing model | Fixed credits | Variable per-second GPU billing | | Setup complexity | API key only | API key + model selection | ## Use Cases - E-commerce product photography automation - Marketplace listing image enhancement (Amazon, Shopify, Etsy) - Bulk background removal for product catalogs - AI-generated lifestyle product scenes - Image upscaling for print-ready assets - Automated product photo pipelines - Background music generation for product videos - Face enhancement for profile photos - Object cleanup in product shots ## Infrastructure PixelAPI runs on self-hosted dedicated NVIDIA GPUs: - RTX 4070 Ti Super 16GB - RTX 4060 Ti 16GB No cloud markup. Models are always loaded and warm — no cold starts. ## Support - Email: support@pixelapi.dev - Documentation: https://pixelapi.dev/docs/ - Dashboard: https://pixelapi.dev/app/ ## Links - Website: https://pixelapi.dev - API: https://api.pixelapi.dev - Docs: https://pixelapi.dev/docs/ - Blog: https://pixelapi.dev/blog/ - Pricing: https://pixelapi.dev/pricing - LLMs.txt: https://pixelapi.dev/llms.txt