Serverless API quickstart
ModelPilot has two paths: dedicated GPU pods for custom ComfyUI workflows, and serverless per-request API for popular open-weight models. This page covers the serverless path. If you have a custom workflow with custom nodes or LoRAs, you want dedicated instead.
When to use serverless (and when not to)
Use serverless when all of these are true:
- The model you need is in the catalog below
- You don't need custom ComfyUI nodes, your own trained LoRAs, or multi-step workflows
- Your traffic is bursty or low-volume (idle costs hurt you)
Use dedicated when:
- You have a working ComfyUI workflow.json you want to host as-is
- You need custom nodes, custom LoRAs, or a model not in the serverless catalog
- You run sustained traffic (8+ hours/day on the same model)
Honest note: for plain “give me Flux Schnell on demand” without ComfyUI, Replicate is often a better choice — broader catalog, faster warm cold starts, lower per-request floor on schnell-class models. See the honest comparison. We exist for users who want both serverless AND custom-workflow dedicated from one provider.
30-second quickstart
Get an API key from your dashboard . Add prepaid credit before the first billable request. Then:
curl -X POST https://modelpilot.ai/api/v1/generate/image \
-H "Authorization: Bearer mp_live_..." \
-H "Content-Type: application/json" \
-d '{"model": "flux-schnell", "prompt": "a red apple on a white table"}'Two response shapes:
- Warm hit: JSON with
imagesarray, sub-second to a few seconds - Cold start:
{ status: "processing", poll_url: "..." }— poll the URL until it returns COMPLETED
What's available — real models, real prices
Prices are charged only on successful completion — failed or throttled jobs are not billed.
Image
| Model | ID | Price | First request |
|---|---|---|---|
| Flux Schnell | flux-schnell | $0.008/image | ~30s cold, sub-second warm |
| Flux Dev | flux-dev | $0.015/image | ~30s cold, sub-second warm |
| Stable Diffusion XL | sdxl | $0.005/image | ~25s cold, sub-second warm |
| Z-Image Turbo | zimage | $0.008/image | ~25s cold, sub-second warm |
Audio (TTS)
| Model | ID | Notes |
|---|---|---|
| Kokoro TTS | kokoro-serverless | 82M params, 50+ voices, 7 languages |
| Chatterbox Turbo | chatterbox-serverless | 350M, expressive, voice cloning |
Text (chat completions, OpenAI-compatible)
Qwen3 4B/8B/32B, DeepSeek R1 8B/14B, GLM-Z1 9B/32B. Per-request pricing $0.01-$0.04 depending on size. First request after a long idle is slower (2-4 min) since the model has to download to a fresh worker; warm cold starts are ~25-35s. Full payload format in the full API reference.
Video
Wan 2.2 T2V is in the model config but the serverless image is not yet built — coming soon. For video today, use the dedicated path via Photo Animator (Wan 2.2 5B image-to-video on a hosted A6000).
Cold start, idle, and what gets charged
- First request, completely cold: 25-30s for image, 2-4 min for text models that need to download weights.
- Warm requests: sub-second to a few seconds depending on model and prompt complexity.
- Idle timeout: 15 minutes. After that, the next request hits a warm cold start (~25-35s) since the worker may be recycled.
- Billing: charged on COMPLETED. Throttled jobs that never run, or jobs that error out, are not billed.
- GPU allocation: we have a 12-GPU fallback list per model (24-48GB secure + community cloud). RunPod schedules your job on whichever has capacity.
Cost examples
Limitations to know
- No custom workflows on serverless yet. If your workflow has custom nodes or trained LoRAs, use dedicated.
- Catalog is intentionally narrow. ~10 popular open-weight models, not thousands. If you need a specific fine-tune that's not listed, dedicated is the path.
- Cold starts are real on first hit. If your app cannot tolerate ~30s first-request latency, keep a warm dedicated pod instead.
- Wan T2V serverless is not live yet — the image hasn't been built. Tracked as task #119.
Next
- Full API reference — request shapes, polling, status codes, error responses
- /pricing — current per-request rates
- ModelPilot vs Replicate — honest comparison, including where Replicate wins
- Sign up to get an API key