The ElevenLabs provider integrates with the portableDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/elevenlabs/llms.txt
Use this file to discover all available pages before exploring further.
Generate::speech() API, letting you swap TTS providers without rewriting application code. ElevenLabs-specific controls — voice settings, normalization, pronunciation dictionaries, and output format strings — are passed through providerOptions('elevenlabs', [...]) so the portable interface stays clean while full provider fidelity is preserved.
Installation
Basic Usage
Build the speech request
Call
Generate::speech() with the text you want to synthesize, then chain .model(), .voice(), .format(), and any provider options before calling .run().Voice IDs
ElevenLabs requires a voice ID for every TTS request. Pass it with the portable.voice() method. If you omit the voice, the adapter throws an InvalidArgumentException before the request is sent.
voice_id inside providerOptions('elevenlabs', [...]), but the portable .voice() method takes precedence.
Output Formats
Use.format() to select an audio format with a portable key. The adapter maps it to the appropriate ElevenLabs format string automatically.
.format() value | ElevenLabs format string | Description |
|---|---|---|
mp3 (default) | mp3_44100_128 | MP3 at 44.1 kHz, 128 kbps |
wav | wav_44100 | WAV at 44.1 kHz |
pcm | pcm_44100 | Raw PCM at 44.1 kHz |
ulaw | ulaw_8000 | µ-law at 8 kHz (telephony) |
alaw | alaw_8000 | A-law at 8 kHz (telephony) |
When you need an ElevenLabs-specific format string that has no portable equivalent — such as
mp3_44100_192 or pcm_22050 — set output_format in providerOptions('elevenlabs', [...]). It overrides the value derived from .format().Provider Options
providerOptions('elevenlabs', [...]) accepts the full set of documented ElevenLabs request fields. The adapter routes them to the correct part of the HTTP request automatically.
Query Parameters
The following fields are sent as URL query parameters, not in the request body, matching the ElevenLabs API contract.An ElevenLabs-specific output format string such as
mp3_44100_192 or pcm_22050. Overrides the value derived from the portable .format() method.When
false, ElevenLabs does not store the request in your history. Sent as enable_logging=false in the query string.Deprecated ElevenLabs latency-optimization level (0–4). Sent as a query parameter. Prefer
eleven_flash_v2_5 for low latency instead.JSON Body Fields
All other fields are merged into the JSON request body alongsidetext and model_id.
Fine-grained voice control. All sub-fields are optional and override the voice’s saved defaults.
stability(float) — Consistency of delivery. Higher values are more predictable; lower values are more expressive.similarity_boost(float) — How closely the output resembles the original voice.style(float) — Stylistic intensity. Only effective on v2 and later models.use_speaker_boost(bool) — Applies a speaker-similarity enhancement pass.
Controls how ElevenLabs normalizes text before synthesis. Accepted values are
auto, on, and off.A BCP-47 language code hint (e.g.
en, fr, de). Improves pronunciation for multilingual models such as eleven_multilingual_v2.Integer seed for deterministic generation. Using the same seed and input should produce the same audio output.
Array of pronunciation dictionary locators to apply. Each entry should be an object with
pronunciation_dictionary_id and optionally version_id.Voice Settings Example
Full Example with All Options
Available Model IDs
eleven_flash_v2_5
Ultra-low-latency model. Best for real-time applications and streaming scenarios.
eleven_v3
Latest high-quality model. Best for expressive, studio-quality voice output.
eleven_multilingual_v2
Multilingual model supporting 29 languages. Use with
language_code for best results.