Skip to main content

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 the Authorization header:
In environment variables:

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.
The NEXT_PUBLIC_ prefix makes the variable available client-side in Next.js. Do not use this prefix for backend API keys.

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
Keep API keys out of version control. If a key appears in a commit, treat it as compromised and rotate immediately — git history is permanent and public repositories are indexed.

Authentication errors

A 401 Unauthorized response means the key is missing, malformed, or invalid:
Check:
  1. The Authorization header is present and formatted as Bearer <key> (not Bearer: <key>)
  2. The key value has no leading or trailing whitespace
  3. The key has not been deleted or expired in Studio
  4. You are using a backend key for a server-side request, not a CORS key

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.
Last modified on April 7, 2026