ElevenLabs Setup
Kartik MDT V2 integrates with ElevenLabs to generate realistic AI text-to-speech audio (used for dispatch call-outs, announcements, and other voice features in the MDT).
All ElevenLabs credentials are configured in:
kartik-mdt-v2/shared/server_config.lua[!IMPORTANT]
server_config.luais server-side only. Never expose these keys inshared/config.luaor anywhere reachable by the client.
๐ง Configuration Block
Open shared/server_config.lua and locate the ServerConfig.ElevenLabs table:
ServerConfig.ElevenLabs = {
enabled = false,
apiKey = "",
voiceId = "",
modelId = "",
stability = 0.5,
similarityBoost = 0.5
}| Field | Description |
|---|---|
enabled | Set to true to enable AI voice generation. Leave false to disable. |
apiKey | Your personal ElevenLabs API key. |
voiceId | The ID of the voice you want to use for TTS output. |
modelId | The ElevenLabs model to use (e.g. eleven_multilingual_v2). |
stability | 0.0 โ 1.0. Higher = more consistent/monotone, lower = more expressive. |
similarityBoost | 0.0 โ 1.0. Higher = closer to original voice sample. |
๐ 1. Where to Get the API Key
- Go to https://elevenlabs.io/ and sign in (or create a free account).
- Click your profile icon (top right) โ Profile + API Key (or My Account โ API Keys).
- Click Create API Key, give it a name (e.g.
FiveM MDT), and copy the key. - Paste it into
apiKey = "".
apiKey = "sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",[!WARNING] Treat the API key like a password. Anyone with it can spend your ElevenLabs credits.
๐ฃ๏ธ 2. Where to Get the Voice ID
- In the ElevenLabs dashboard, open the Voices section (left sidebar โ Voices / VoiceLab).
- Pick a voice from the Voice Library (add it to My Voices) or use one you've cloned.
- Click the voice โ open the โฎ (three dots) menu โ Copy Voice ID.
- Alternatively, the Voice ID is shown in the URL when viewing the voice.
- Paste it into
voiceId = "".
voiceId = "21m00Tcm4TlvDq8ikWAM",๐ค 3. Where to Get the Model ID
ElevenLabs offers multiple models. Common values:
| Model ID | Notes |
|---|---|
eleven_multilingual_v2 | Best quality, supports 29+ languages. Recommended. |
eleven_turbo_v2_5 | Faster, lower latency, slightly lower quality. |
eleven_monolingual_v1 | Older English-only model. |
To see the full list:
- Visit https://elevenlabs.io/docs/api-reference/models, or
- In the dashboard, go to Speech Synthesis, the model dropdown lists every available
model_id.
modelId = "eleven_multilingual_v2",๐๏ธ 4. Stability & Similarity Boost
These two sliders control how the voice sounds. You can preview them live in the ElevenLabs Speech Synthesis playground before committing values.
stability(default0.5)- Low (โ0.2) โ more emotion and variation, but can sound unstable.
- High (โ0.75) โ very consistent, but flatter delivery.
similarityBoost(default0.5)- Low โ more creative, can drift from the original voice.
- High โ sticks closely to the voice sample.
For police/dispatch style call-outs, stability = 0.6 and similarityBoost = 0.75 is a good starting point.
โ Final Example
ServerConfig.ElevenLabs = {
enabled = true,
apiKey = "sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
voiceId = "21m00Tcm4TlvDq8ikWAM",
modelId = "eleven_multilingual_v2",
stability = 0.6,
similarityBoost = 0.75
}After saving the file, restart the kartik-mdt-v2 resource:
ensure kartik-mdt-v2or in the live console:
restart kartik-mdt-v2