Every request to the Livepeer AI Gateway API requires a Bearer token. Obtain one from Livepeer Studio under Settings > API Keys. Two key types exist — choose based on where your code runs.
API key types
A backend key in client-side code is a critical security vulnerability. Use the correct type for the deployment context.Using a backend API key
Pass the key as a Bearer token in theAuthorization header:
CORS-enabled keys for browser applications
When your frontend makes direct API calls, create a CORS-enabled key in Studio. The Studio dashboard scopes the key to specific asset or stream IDs — a leaked CORS key cannot access other resources in your account. Create in Studio: Settings > API Keys > Create Key > Enable CORS.Key rotation
Rotate API keys on a schedule and immediately if a key is exposed. Studio lets you create multiple active keys and delete compromised ones without downtime. Recommended rotation schedule:- Production backend keys: every 90 days
- After any team member offboarding
- Immediately after any suspected exposure
Authentication errors
A401 Unauthorized response means the key is missing, malformed, or invalid:
- The
Authorizationheader is present and formatted asBearer <key>(notBearer: <key>) - The key value has no leading or trailing whitespace
- The key has not been deleted or expired in Studio
- You are using a backend key for a server-side request, not a CORS key
Related pages
SDK Integration Guide
Full SDK setup with authentication patterns for TypeScript, Python, and Go.
Video Access Control
JWT and webhook-based access control for gating streams and assets.