Everything you need to plug in Lavahost.
These docs cover how to point your Discord bot at Lavahost, search for and play tracks, and manage your account. They're aimed at developers integrating an existing Lavalink client — no prior infrastructure setup needed.
Quick start
From zero to playing audio in about a minute:
- 1Open the dashboard, click Create key, copy the key it shows (it's only displayed once).
- 2Drop the host, port, and key into your Lavalink client's config. Endpoint values are shown above on the dashboard:host: "gateway.lavahost.net", port: 443, secure: true
- 3In your bot, call
player.search("your query")thenplayer.play(). That's it.
Connection details
Your account gets one endpoint shared across every bot you connect. The same host serves both the WebSocket (events) and the REST API (commands).
Every request must include your API key in the Authorization header. WebSocket connections also need User-Id (your bot's Discord user-id) and an optional Client-Name for logging.
Client libraries
Lavahost speaks Lavalink v4 — anything that supports the v4 protocol works without modification. Below are configs for the most common clients.
Search & loading tracks
Lavahost ships with a built-in search source. Pass a query through your client's loadTracks / search() and you'll get a ranked list of matching tracks back.
Search by query
The search: prefix is optional — "never gonna give you up" and "search:never gonna give you up" are equivalent. Both return up to ~10 results ranked by relevance.
Search by URL
Direct URLs resolve to the matching track(s). Supported sources:
- Spotify — track, album, playlist, artist
- Tidal — track, album, playlist, artist
- Deezer — track, album, playlist, artist
For albums, playlists and artists, the response is loadType: "playlist" with the full list of tracks under data.tracks. For a single track URL you get loadType: "track".
Search by ISRC
An ISRC uniquely identifies a recording, so we look it up exactly rather than by relevance. Pass the code on its own ("USUM71703861") or with the isrc: prefix ("isrc:USUM71703861") — both are equivalent. The hyphenated form ("US-UM7-17-03861") is accepted too. You get back loadType: "track" with the single matching recording, not a ranked search list.
Response shape
Standard Lavalink v4 load-tracks response. loadType is one of track, playlist, search, empty, or error. Each track carries info (title, author, duration, isrc, artworkUrl) and an opaque encoded string that you pass back when you call play.
API keys
API keys are how your bot identifies itself to Lavahost. Keys are scoped to your account; one key can connect any number of bots, but issuing one per bot makes usage easier to attribute and lets you revoke a single bot without affecting the others.
Format
lh_ followed by 48 hex characters. Always send it as the Authorization header on every WebSocket upgrade and every REST call:
Storage
The full plaintext key is shown only once, when you click Create key on the dashboard. Store it in your bot's secret manager (a .env file, a hosted secret store, etc.) and never commit it to a public repo. We never display it again — if you lose it, revoke and reissue.
Revoking
Hit Revoke on the dashboard. The next request the bot makes with that key returns 401 Unauthorized. Revocation is instant — no propagation delay.
Sessions & resume
A "session" is one WebSocket connection. When your bot reconnects after a network blip, you can resume the previous session and Lavalink replays any events you missed — no audio interruption, no need to recreate players.
Enabling resume
After the first ready op:
Timeout is in seconds. Maximum allowed is 600. Most Lavalink client libraries configure this for you automatically.
Reconnecting
Reopen the WebSocket and include the previous Session-Id in the upgrade headers. The server responds with { op: "ready", resumed: true, sessionId: <same> } if the session was still alive, otherwise resumed: false and a fresh sessionId — rebuild your players from scratch when that happens.
Per-account scope
Sessions belong to the account that opened them. Another account using a guessed sessionId gets a 403 on every REST call and a clean close on WS resume.
Troubleshooting
- API key is wrong or has been revoked.
- Missing Authorization header.
- Passing the key with a leading "Bot " prefix (Discord-style) — drop the prefix.
- The sessionId in the path doesn't exist (expired, never opened, or typo).
- The sessionId belongs to a different account.
- Your client sent an unrecognised field in the player update body (newer Lavalink protocol field, or a typo).
- voice.endpoint isn't a valid Discord voice endpoint — usually means your client is forwarding the wrong Discord event payload.
- volume out of range (allowed 0–1000), position negative, etc.
- The track exists in our catalogue but couldn't be streamed (rare; usually a transient issue with the source). Try a different result from the same search.
- Your bot lacks Speak permission in the voice channel.
- Bot is server-deafened or self-deafened (check Discord, not just Lavalink).
- Voice channel permissions block Speak.
- Voice region mismatch — Discord assigned a region the voice connection can't reach. Try moving to a different VC.
- Backend stopped producing frames — usually transient. The client should auto-skip after the threshold.
FAQ
search() with a query or a Spotify URL — no plugins to install, no API keys to manage, no rate limits to worry about.[email protected]. Include your account's Discord username and (if applicable) the sessionId from your dashboard for fast triage.