Gateway selection
| Environment | Gateway URL | When to use |
|---|---|---|
| Development / testing | https://dream-gateway.livepeer.cloud | Free, no API key required, unpredictable latency |
| Production | https://livepeer.studio/api/beta/generate | Studio-managed, authenticated, SLA-backed |
Authentication
- API key stored in environment variables, never in source code
- Backend API key used for server-side requests; CORS-enabled key for browser-side
- Key rotation schedule set (90-day recommended)
-
.envfiles excluded from version control via.gitignore - Dependency scanning (e.g., Dependabot, Snyk) configured to detect accidental key exposure
Error handling
-
401handler: log and surface a configuration error — do not retry; the key is wrong -
422handler: log the full response body to identify the failing field; fix the request shape -
503handler: retry with exponential backoff; cold model load is expected behaviour, not a failure -
429handler: back off and retry; check rate limits in Studio dashboard - Global timeout set on all requests (recommended: 300 seconds for cold model scenarios)
- SDK retry configuration enabled with exponential backoff (see SDK Integration Guide)
Model selection
Choose warm models for latency-sensitive paths. Cold model load times range from 30 seconds to several minutes. Warm models respond immediately.| If you need… | Use warm model |
|---|---|
| Text to image | SG161222/RealVisXL_V4.0_Lightning |
| Image to image | timbrooks/instruct-pix2pix |
| Audio transcription | openai/whisper-large-v3 |
| LLM completion | meta-llama/Meta-Llama-3.1-8B-Instruct |
model_id values cold-start on every request until an orchestrator warms them. Test custom models under expected load before launch.
Cost estimation
AI inference pricing is orchestrator-set. The current indicative rate for text-to-image is approximately $0.019 per megapixel of output. Illustrative example for text-to-image at 1024x1024:- 1024 x 1024 = 1,048,576 pixels = 1.05 megapixels
- At 0.020 per image
- At 1,000 images/day: approximately $20/day
Monitoring
- Log HTTP status codes for all gateway requests
- Track p50, p95, p99 latency per pipeline
- Alert on sustained
503rate above 5% (indicates warm model unavailability) - Alert on sustained
5xxrate above 1% (indicates inference failures) - Monitor Studio billing dashboard weekly during ramp-up
Launch readiness summary
- Production gateway URL configured (
livepeer.studio/api/beta/generate) - Backend API key in secrets manager, not in code
- CORS-enabled key used for browser-side calls
- Retry policy implemented with exponential backoff
- All error types (
401,422,503,429) handled - Warm models used for latency-sensitive paths
- Cost projection completed and budget alert set in Studio
- Status page subscribed: https://status.livepeer.studio
- Incident response contact: Livepeer Discord
#buildersor support@livepeer.org
Related pages
AI Authentication
API key types, CORS keys, and rotation strategy.
AI Troubleshooting
Diagnose errors by status code.
SDK Integration Guide
Retry configuration and error handling in TypeScript, Python, and Go.