Overview
Since Vyla API is self-hosted, you manage your own API keys and authentication. The API supports two authentication methods depending on your use case.You must set up your own API keys when deploying your Vyla API instance. See Self-Hosting for instructions on creating and managing API keys in your SQLite database.
Session Tokens (Browser / Player)
If you are building a browser-based player or client-side application, use session tokens. Your API key never leaves the browser — your server callsPOST /api/auth with a valid API key to receive a short-lived token, then sends that token down to the client for use on subsequent requests.
Step 1 — Get a token (server-side)
POST /api/auth requires a valid API key from your self-hosted instance. The token inherits the tier of the key used to obtain it — a public key issues a public-tier token, a standard key issues a standard-tier token, and so on.
Step 2 — Send the token (client-side)
POST /api/auth/refresh instead of re-issuing from /api/auth — this avoids sending your API key to the browser again.
Step 3 — Refresh the token (client-side)
/api/auth.
Token errors
API Keys (Server-Side / Direct Access)
API keys are for server-side integrations and direct API access where the key is never exposed to end users. Rate limits are enforced per API key — not per IP address or per user. Each request made with the same key counts toward that key’s limit regardless of where it originates.
When you self-host Vyla API, a default public key is automatically created:
/api/health, /api/subtitles, /api/downloads).
Sending your key
API key errors
Rate Limiting
Rate limits are tracked per API key. Session token requests (authenticated viaX-Session-Token) are not subject to rate limiting — only direct API key usage is counted.
When a limit is exceeded the API returns 429 with a JSON body:
resetAt is a Unix timestamp in milliseconds indicating when the window resets.

