API Documentation

Programmatic access to AI video, image, audio generation and editing tools.

Authentication Quick Start Video Generation Image Generation Audio & TTS Editing & Tools Studio & Projects Hosting Community Stock Media Organisations Brand Kits Settings & Billing Prompt Tools Models Credit Costs Subscription Tiers Rate Limits Errors

Authentication

All API requests require a Bearer token unless noted as public

Create an API key in Settings → API Keys, then include it in the Authorization header of every request:

HTTP Header
Authorization: Bearer pk_your_api_key_here

API keys inherit the permissions of the account that created them, including tier limits and admin access. The full key is only shown once at creation — store it securely.

API Key Management

MethodEndpointDescription
GET/api/keysList your API keys (id, prefix, name, created_at, last_used, is_active)
POST/api/keysCreate key — body: {"name":"My App"} — returns full key once
DELETE/api/keys/{id}Revoke an API key

Quick Start

Generate a video in three API calls

Start Here

1. Submit a generation → 2. Poll for completion → 3. Download the video.

cURL Example
# 1. Submit generation curl -X POST https://video.progressiverobot.com/api/generate \ -H "Authorization: Bearer pk_your_key" \ -H "Content-Type: application/json" \ -d '{"model":"wan-t2v","prompt":"A cinematic sunrise over mountains"}' # Returns: {"job_id":"abc123","prompt_id":"...","credits_used":14,"credit_balance":486} # 2. Poll status curl https://video.progressiverobot.com/api/status?job_id=abc123 \ -H "Authorization: Bearer pk_your_key" # Returns: {"status":"completed","filename":"webgen_abc123_00001.mp4"} # 3. Download video curl -o video.mp4 https://video.progressiverobot.com/api/video/webgen_abc123_00001.mp4 \ -H "Authorization: Bearer pk_your_key"
Python Example
import requests, time API = "https://video.progressiverobot.com" KEY = "pk_your_key" HDR = {"Authorization": f"Bearer {KEY}"} # 1. Submit r = requests.post(f"{API}/api/generate", headers=HDR, json={ "model": "wan-t2v", "prompt": "A cinematic sunrise over mountains" }) job_id = r.json()["job_id"] # 2. Poll while True: s = requests.get(f"{API}/api/status", headers=HDR, params={"job_id": job_id}).json() if s["status"] == "completed": break if s["status"] == "error": raise Exception(s.get("error", "Generation failed")) time.sleep(3) # 3. Download vid = requests.get(f"{API}/api/video/{s['filename']}", headers=HDR) with open("video.mp4", "wb") as f: f.write(vid.content)
JavaScript Example
const API = "https://video.progressiverobot.com"; const KEY = "pk_your_key"; const headers = { "Authorization": `Bearer ${KEY}`, "Content-Type": "application/json" }; // 1. Submit const gen = await fetch(`${API}/api/generate`, { method: "POST", headers, body: JSON.stringify({ model: "wan-t2v", prompt: "A cinematic sunrise over mountains" }) }).then(r => r.json()); // 2. Poll let status; do { await new Promise(r => setTimeout(r, 3000)); status = await fetch(`${API}/api/status?job_id=${gen.job_id}`, { headers }).then(r => r.json()); } while (status.status === "processing"); // 3. Download const blob = await fetch(`${API}/api/video/${status.filename}`, { headers }).then(r => r.blob());

Video Generation

Text-to-video, image-to-video, extend, and video-to-video

Core

POST /api/generate

Queue a text-to-video or image-to-video generation. Returns a job_id to poll.

Request Body (JSON)
{ "model": "wan-t2v", "prompt": "A cinematic shot of a golden sunrise over mountains", "negative_prompt": "blurry, distorted", "width": 848, "height": 480, "frames": 41, "steps": 4, "cfg": 1, "seed": -1, "sampler": "sa_solver", "scheduler": "beta", "shift": 8, "frame_rate": 24 }

Parameters

FieldTypeRequiredDescription
promptstringYesText description (max 2000 chars)
modelstringNoModel ID — see Models
negative_promptstringNoWhat to avoid in the output
widthintNoVideo width in pixels
heightintNoVideo height in pixels
framesintNoNumber of frames (tier-limited)
stepsintNoInference steps — more = higher quality, higher cost
cfgnumberNoClassifier-free guidance scale
seedintNoRandom seed (-1 for random)
samplerstringNoSampler name (e.g. sa_solver, euler, dpmpp_2m)
schedulerstringNoScheduler name (e.g. beta, normal, karras)
shiftnumberNoFlow-shift parameter
frame_rateintNoOutput frame rate (default 24)
project_idintNoLink generation to a studio project
Response
{ "job_id": "abc12345", "prompt_id": "...", "credits_used": 14, "credit_balance": 486 }
Error — Insufficient Credits
{ "error": "Not enough credits", "cost": 14, "balance": 3, "upgrade_url": "/pricing" }

GET /api/status?job_id={id}

Poll for generation progress. Call every 2-5 seconds until status is completed or error.

Response (processing)
{ "status": "processing" }
Response (completed)
{ "status": "completed", "filename": "webgen_abc12345_00001.mp4" }
Response (error)
{ "status": "error", "error": "Generation failed" }

GET /api/video/{filename}

Download the generated video file. Returns raw video/mp4 bytes. You must own the video, or provide a valid share ?token=.


GET /api/generations

List your video generation history with full metadata.

Query ParamTypeDefaultDescription
limitint50Max results (up to 200)
offsetint0Pagination offset
Response
{ "generations": [ { "id": 1, "job_id": "abc123", "model": "wan-t2v", "prompt": "...", "negative_prompt": "...", "filename": "webgen_abc123_00001.mp4", "width": 848, "height": 480, "frames": 41, "steps": 4, "cfg": 1, "seed": 42, "sampler": "sa_solver", "scheduler": "beta", "frame_rate": 24, "shift": 8, "is_favorite": 0, "is_public": 0, "share_token": null, "status": "completed", "created_at": "2026-03-30 12:00:00" } ], "total": 142 }

Additional Video Endpoints

MethodEndpointBody / ParamsDescription
DELETE/api/generations/{id}Delete a generation and its video file
POST/api/generations/{id}/favoriteToggle favourite — returns is_favorite
POST/api/generations/{id}/shareCreate share link — returns share_token
POST/api/generations/{id}/publicToggle public gallery visibility
GET/api/share/{token}Public — get shared video metadata
GET/api/gallery/communityPublic — browse public gallery
POST/api/cancel{"job_id":"..."}Cancel a running generation
GET/api/queueQueue length, your active jobs, and position
GET/api/comfyui/statusCheck if backend GPU is online
GET/api/generation-cost?model=&frames=&steps=Quote credit cost without generating
POST/api/extend-video{"video_filename":"...","generation_id":1}Extract last frame for video extension via I2V
POST/api/generate-v2v{"video_filename":"...","prompt":"...","strength":0.6}Video-to-video style transfer

Image Generation

Generate images and upload input images for I2V

POST /api/generate-image

Queue one or more image generations. Returns an array of job IDs to poll via /api/status.

Request Body (JSON)
{ "prompt": "A futuristic city at sunset, neon lights", "model": "sd15", "num_images": 2, "negative_prompt": "blurry", "seed": -1, "steps": 20, "cfg": 7, "width": 512, "height": 512 }
Response
{ "jobs": [ { "job_id": "img_001", "prompt_id": "...", "seed": 42 }, { "job_id": "img_002", "prompt_id": "...", "seed": 43 } ], "credits_used": 4, "credit_balance": 496 }

Image Endpoints

MethodEndpointDescription
GET/api/image-modelsList image models (id, name, defaults, credit_cost)
GET/api/image-generationsList image history — ?limit=&offset=
DELETE/api/image-generations/{id}Delete an image generation
GET/api/image/{filename}Download a generated image
POST/api/upload-imageUpload image for I2V (multipart, PNG/JPEG/WebP, max 10 MB)
GET/api/input-image/{filename}Serve uploaded/extracted input image

Audio, Subtitles & TTS

Generate music, speech, subtitles, and mix into videos

POST /api/generate-audio

Generate music or sound effects from a text description.

Request Body
{ "prompt": "Upbeat electronic music with synth pads", "duration_seconds": 30, "tags": "electronic, upbeat" }

POST /api/tts/generate

Generate voice narration from text. Requires Creator tier or higher.

Request Body
{ "text": "Welcome to Progressive Robot, the AI video platform.", "voice_id": "en_gb_male", "speed": 1.0 }
Response
{ "audio_url": "/api/audio/tts_abc123.wav", "duration_seconds": 4.2, "credit_balance": 494 }

All Audio & Subtitle Endpoints

MethodEndpointBody / ParamsDescription
POST/api/generate-audio{"prompt","duration_seconds","tags"}Generate music/SFX (8 credits per 30s)
GET/api/audio-generationsList audio generation history
DELETE/api/audio-generations/{id}Delete audio generation
GET/api/audio/{filename}Download generated audio file
POST/api/video/add-audio{"video_filename","audio_filename"}Merge audio onto a video
POST/api/subtitles/generate{"video_filename","language":"en"}Auto-generate subtitles with Whisper (5 credits)
GET/api/subtitles/{name}.srtDownload subtitle file
POST/api/subtitles/burn{"video_filename","srt_filename","style"}Burn subtitles into video (styles: default, bold-yellow, minimal)
POST/api/subtitles/translate{"srt_filename","target_language"}AI translate subtitles (Pro+ required, 5 credits)
GET/api/tts/voicesList available TTS voices
POST/api/tts/generate{"text","voice_id","speed"}Generate speech (Creator+, 6 credits/min)
POST/api/tts/add-to-video{"video_filename","tts_filename","offset_seconds","volume"}Mix TTS audio into a video

TTS Voices

Voice IDDescription
en_gb_maleBritish English — Male
en_gb_femaleBritish English — Female
en_us_maleAmerican English — Male
en_us_femaleAmerican English — Female

Editing & Tools

Trim, crop, resize, upscale, background removal, face swap, and more

POST /api/edit/trim

Trim a video to a specific time range.

Request Body
{ "video_filename": "webgen_abc123_00001.mp4", "start_seconds": 1.5, "end_seconds": 4.0 }
Response
{ "filename": "trimmed_abc123.mp4", "credit_balance": 497 }

Edit Endpoints (3 credits each)

MethodEndpointKey ParametersDescription
POST/api/edit/trimstart_seconds, end_secondsTrim video to time range
POST/api/edit/speedspeed_factor (0.25–4.0)Change playback speed
POST/api/edit/cropx, y, width, heightCrop video region
POST/api/edit/resizepreset or width, heightResize & pad video (presets: 1080p, 720p)
POST/api/edit/text-overlaytext, position, font_size, color, start_time, end_timeBurn text overlay onto video
POST/api/edit/mergevideo_filenames (array, 2–20)Concatenate multiple videos

AI Tools

MethodEndpointKey ParametersCreditsDescription
POST/api/tools/remove-backgroundMultipart image upload1AI background removal
POST/api/tools/upscale-videovideo_filename, scale_factor (2–4)~2/10sUpscale video (Creator+)
POST/api/tools/face-swapMultipart: two image files1AI face swap (Pro+)
POST/api/tools/extract-framesvideo_filename, mode1Extract frames (first, last, middle, all_1fps)
POST/api/tools/trim-videovideo_filename, start_time, end_time1Simple trim utility
POST/api/tools/video-to-gifvideo_filename, width, fps1Convert video to animated GIF
POST/api/tools/add-watermarkMultipart: video_filename, type, text/image1Add text or image watermark

Studio & Projects

Multi-shot project management and AI script breakdown

POST /api/studio/script-to-shots

Use AI to break a script into individual shot prompts.

Request Body
{ "script": "A hero walks through a dystopian city. She finds a glowing artifact...", "shot_count": 4, "style": "cinematic sci-fi" }
Response
{ "shots": [ "Wide establishing shot of a crumbling cityscape...", "Medium shot tracking the hero walking through debris...", "Close-up of glowing artifact pulsing with light...", "Hero reaches out to touch the artifact, dramatic lighting..." ] }

Project Endpoints

MethodEndpointBody / ParamsDescription
GET/api/projectsList projects (with shot_count and cover)
POST/api/projects{"name":"My Film"}Create project
GET/api/projects/{id}Get project with shots array and generations
PUT/api/projects/{id}{"name","description","model"}Update project metadata
DELETE/api/projects/{id}Delete project and all shots
POST/api/projects/{id}/duplicateDuplicate project with all shots & elements
POST/api/projects/{id}/export{"resolution":"1080p"}Export project — concatenates shot videos

Shot Endpoints

MethodEndpointBody / ParamsDescription
POST/api/projects/{id}/shots{"prompt","notes","duration","shot_type","camera_move","transition"}Add shot to project
PUT/api/projects/{id}/shots/{shotId}Same fields as above + filenameUpdate shot (link a generation via filename)
DELETE/api/projects/{id}/shots/{shotId}Delete shot
POST/api/projects/{id}/shots/reorder{"order":[3,1,2]}Reorder shots by ID array

Elements & Comments

MethodEndpointDescription
GET/api/projects/{id}/elementsList project elements (characters, props, locations)
POST/api/projects/{id}/elementsCreate element
PUT/api/projects/{id}/elements/{eid}Update element
DELETE/api/projects/{id}/elements/{eid}Delete element
GET/api/projects/{id}/commentsList project comments
POST/api/projects/{id}/commentsAdd comment — {"text","shot_id"}
DELETE/api/projects/{id}/comments/{cid}Delete comment

Hosting & Landing Pages

Create hosted video landing pages with analytics — Pro tier and above

POST /api/hosting/pages

Create a hosted landing page for a video. Returns a public URL and embed code.

Request Body
{ "generation_id": 42, "title": "Product Demo Video", "description": "Our latest AI-generated product showcase", "slug": "product-demo", "cta_text": "Learn More", "cta_url": "https://example.com", "allow_embed": true }
Response
{ "id": 1, "slug": "product-demo", "page_url": "https://video.progressiverobot.com/v/product-demo", "embed_code": "<iframe src=\".../v/product-demo/embed\"></iframe>" }

Hosting Endpoints

MethodEndpointDescription
GET/api/hosting/pagesList your hosted pages
GET/api/hosting/pages/{id}Get page details
PUT/api/hosting/pages/{id}Update page (title, description, CTA, password, visibility)
DELETE/api/hosting/pages/{id}Delete hosted page
GET/api/hosting/pages/{id}/analyticsView analytics (total views, unique views, referrers, daily breakdown)

Community Prompts

Browse, share, and vote on prompts

MethodEndpointAuthDescription
GET/api/community/promptsPublicBrowse approved prompts — ?sort=popular&tag=cinematic&model=wan-t2v&page=1
POST/api/community/promptsAuthSubmit a prompt for moderation — {"prompt","model","title","tags"}
POST/api/community/prompts/{id}/voteAuthUpvote or downvote — {"vote":1}
POST/api/community/prompts/{id}/useAuthIncrement use count and retrieve prompt text
DELETE/api/community/prompts/{id}AuthDelete own prompt (admin can delete any)

Stock Media

Search and download royalty-free videos, images, and music — Creator tier and above

MethodEndpointParamsDescription
GET/api/stock/videos?query=&page=&per_page=Search Pexels videos (max 30/page)
GET/api/stock/images?query=&page=&per_page=Search Pexels images (max 30/page)
GET/api/stock/music?query=Search Pixabay music
POST/api/stock/download{"url","type"}Download stock asset to local storage

Organisations

Team collaboration and shared projects — Pro tier and above

MethodEndpointBody / ParamsDescription
POST/api/orgs{"name":"My Team"}Create organisation (Pro+)
GET/api/orgsList your organisations
POST/api/orgs/{id}/invite{"email","role"}Invite member (roles: member, admin, reviewer)
POST/api/orgs/accept-invite{"token":"..."}Accept invitation
GET/api/orgs/{id}/membersList org members
PUT/api/orgs/{id}/members/{uid}/role{"role":"admin"}Change member role (org admin only)
DELETE/api/orgs/{id}/members/{uid}Remove member (org admin only)
GET/api/orgs/{id}/projectsList organisation projects
POST/api/orgs/{id}/projects{"name":"Team Project"}Create organisation project

Brand Kits

Custom branding overlays, logos, and intros — Pro tier and above

POST /api/brand-kits

Create a brand kit with custom colours, fonts, and positioning.

Request Body
{ "name": "My Brand", "primary_color": "#7c3aed", "secondary_color": "#1e1b4b", "font_family": "Inter", "default_text_position": "bottom-right", "default_text_color": "#ffffff", "default_text_size": 24 }

MethodEndpointDescription
GET/api/brand-kitsList brand kits
PUT/api/brand-kits/{id}Update brand kit settings
DELETE/api/brand-kits/{id}Delete brand kit
POST/api/brand-kits/{id}/upload-logoUpload logo (multipart)
POST/api/brand-kits/{id}/upload-introUpload intro clip (multipart)
POST/api/brand-kits/{id}/applyApply brand kit to video — {"video_filename":"..."}

Prompt Tools & Templates

AI prompt generation, autocomplete, and saved templates

POST /api/generate-prompt

Use AI to generate or enhance video prompts from a simple idea.

Request Body
{ "idea": "cat in space", "model": "wan", "style": "cinematic", "mood": "epic", "count": 3, "enhance": true }
Response
{ "prompts": [ "A majestic orange tabby cat floating weightlessly...", "Cinematic close-up of a cat in a space helmet...", "Wide shot of a cat leaping between asteroids..." ], "negative": "blurry, distorted, low quality" }

MethodEndpointDescription
GET/api/prompts/autocompleteGet prompt suggestions from your history
GET/api/templatesList saved prompt templates
POST/api/templatesSave template — {"name","prompt","negative_prompt","model"}
DELETE/api/templates/{id}Delete template

Settings, Profile & Billing

Account management, subscription, and credit top-ups

MethodEndpointBody / ParamsDescription
Auth & Session
GET/api/auth/checkCurrent auth state, tier, credit balance, limits
POST/api/signup{"username","password","email"}Create account (public)
POST/api/login{"username","password"}Log in (public)
POST/api/logoutLog out (clears session cookie)
POST/api/password-reset/request{"username":"..."}Request password reset email (public)
POST/api/password-reset/reset{"token","new_password"}Complete password reset (public)
Profile
GET/api/profileGet profile (username, display_name, bio, avatar)
POST/api/profile{"display_name","bio","profile_public"}Update profile
POST/api/profile/avatarMultipart image uploadUpload avatar
Settings
POST/api/settings/change-password{"current_password","new_password"}Change password (min 8 chars)
POST/api/settings/email{"email":"..."}Update email address
POST/api/settings/theme{"theme":"dark"}Set theme (dark or light)
Credits & Billing
GET/api/creditsCredit balance, tier, monthly allowance
GET/api/credits/historyCredit transaction ledger
POST/api/credits/topup{"credits":500}Purchase credits (100–50,000 at 1p each)
GET/api/subscriptionCurrent subscription details
POST/api/stripe/create-checkout{"tier":"creator"}Start Stripe subscription checkout
POST/api/stripe/create-portalOpen Stripe customer portal (manage billing)
GET/api/pricingPublic — tier pricing and credit cost rules
GET/api/stripe/configPublic — Stripe publishable key
Analytics
GET/api/analytics/usagePer-day generation and credit spending breakdown
GET/api/analytics/summaryTotal generations, images, video minutes, favourite model

Available Models

All supported generation models and their capabilities

Video Models (Text-to-Video)

Model IDNameBest For
wan-t2vWAN 2.2Rich cinematic visuals, longer videos
ltx-t2vLTX 2.3Fast generation, HD output
ltx-qualityLTX QualityHighest quality, 2-pass upscale to 4K
hunyuan-t2vHunyuanSmooth motion, natural movement
hunyuan15-t2vHunyuan 1.5Improved motion, latest Hunyuan release
cogvideo-t2vCogVideoX 1.5High fidelity 5B model, diverse styles
animatediffAnimateDiffSD 1.5-based animation, fast & lightweight
ltx-cameraLTX Camera ControlCamera dolly movements (in, out, left, right) via LoRA
ltx-controlLTX ControlNetControlNet-guided generation (depth, edge, pose)
wan-vaceWAN VACEVideo conditioning & editing with subject/scene control
wan-animateWAN AnimateCharacter animation from a single reference image

Video Models (Image-to-Video)

Model IDNameDescription
hunyuan15-i2vHunyuan 1.5 I2VAnimate a still image into video
ltx-i2vLTX 2.3 I2VFast image-to-video generation
svd-i2vSVD XT I2VStable Video Diffusion image-to-video
wan-i2vWAN 2.2 I2VHigh-quality 14B image-to-video with Lightx2v turbo

Video Models (First-Last Frame)

Model IDNameDescription
ltx-flfLTX 2.3 First-Last FrameInterpolate between two keyframe images with prompt guidance
wan-flfWAN 2.2 First-Last FrameWAN 14B first & last frame interpolation with Lightx2v turbo

Video Models (Sound-to-Video)

Model IDNameDescription
wan-s2vWAN 2.2 Sound-to-VideoGenerate talking-head video from a portrait image + audio clip

Specialised Models

Model IDNameDescription
liveportraitLivePortraitAnimate a portrait photo with facial expressions from a driving video
dreamidvDreamID-VFace identity transfer — insert a face into generated video
echomimicEchoMimicAudio-driven talking portrait from a single photo + audio clip
hunyuan3dHunyuan3D v2Generate 3D model assets from a text prompt or reference image

Image Models

Model IDNameCredit Cost
sd15Stable Diffusion 1.52 credits per image
fluxFlux 2 Klein5 credits per image
flux-devFlux 2 Dev8 credits per image
flux-editFlux 2 Image Edit6 credits per image

Use GET /api/models for video models or GET /api/image-models for image models to retrieve live defaults and parameters at runtime.

Credit Costs

How credits are calculated for each operation

Video Generation Cost Formula

cost = base + (frames × per_frame) + (steps × per_step)

ModelBasePer FramePer StepExample (41 frames, 4 steps)
wan-t2v100.200.5020.2 → 21 credits
ltx-t2v80.150.3015.35 → 16 credits
ltx-quality150.250.4026.85 → 27 credits
hunyuan-t2v120.200.4021.8 → 22 credits
hunyuan15-t2v120.200.4021.8 → 22 credits
hunyuan15-i2v150.250.5027.25 → 28 credits
ltx-i2v120.200.4021.8 → 22 credits
cogvideo-t2v120.200.4021.8 → 22 credits
animatediff60.100.308.8 → 9 credits
svd-i2v100.150.4017.75 → 18 credits
wan-i2v120.200.5022.2 → 23 credits
ltx-flf120.150.3018.55 → 19 credits
wan-s2v150.250.5027.25 → 28 credits
wan-flf120.200.5022.2 → 23 credits
ltx-camera100.150.3017.15 → 18 credits
ltx-control120.150.3018.55 → 19 credits
wan-vace150.250.5027.25 → 28 credits
wan-animate180.300.5032.3 → 33 credits
liveportrait80.1012.1 → 13 credits
hunyuan3d200.8023.2 → 24 credits
dreamidv150.200.4024.8 → 25 credits
echomimic120.150.3018.55 → 19 credits
v2v33 credits (flat)

Other Operation Costs

OperationCredits
Image generation (SD 1.5)2 per image
Image generation (Flux 2 Klein)5 per image
Image generation (Flux 2 Dev)8 per image
Image generation (Flux 2 Edit)6 per image
Audio generation (ACE-Step)8 per 30 seconds (pro-rated)
TTS voice generation6 per minute (pro-rated)
Subtitle generation (Whisper)5 flat
Subtitle translation5 flat
Video edit (trim, speed, crop, resize, text overlay, merge)3 each
Remove background1
Face swap1
Extract frames1
Trim video (tools)1
Video to GIF1
Add watermark1
Upscale video~2 per 10 seconds (min 2)
Video-to-video~3 per 10 seconds (min 3)
Project exportmax(3, 2 × clip count)
Merge videosmax(3, 2 × clip count)

Use GET /api/generation-cost?model=wan-t2v&frames=41&steps=4 to get an exact quote before generating.

Subscription Tiers

Feature limits by plan

TierMonthly CreditsMax ResolutionMax FramesWatermark
Free150480p81Yes
Starter5001080p121No
Creator1,5004K201No
Pro5,0004K301No
Studio15,0004K301No
Enterprise50,0004K999No

Some features require specific tiers: Stock Media (Creator+), TTS (Creator+), Hosting (Pro+), Organisations (Pro+), Brand Kits (Pro+), Subtitle Translation (Pro+), Upscale (Creator+), Face Swap (Pro+).

Rate Limits

Request limits and body size constraints

API Rate Limit10 requests per 60 seconds per user
Signup Limit5 per IP per hour
Login Limit10 per IP per 5 minutes
Max POST Body10 MB
Max JSON Body1 MB
Max Prompt Length2,000 characters
Image Upload Limit10 MB (PNG, JPEG, WebP)

Error Handling

Standard error response format and HTTP status codes

All API errors return JSON with an error field. Some errors include additional context fields.

Standard Error
{ "error": "Unauthorized" } // 401 { "error": "Forbidden" } // 403 { "error": "Not found" } // 404 { "error": "Rate limit exceeded" } // 429
Credit Error (includes cost data)
{ "error": "Not enough credits", "cost": 21, "balance": 5, "upgrade_url": "/pricing" }

HTTP Status Codes

CodeMeaning
200Success
400Bad request — missing or invalid parameters
401Unauthorized — missing or invalid API key
403Forbidden — insufficient tier or permissions
404Resource not found
429Rate limit exceeded
500Internal server error