# ElevenLabs

> Use ElevenLabs for streaming text-to-speech, the default voice in a cascade. You can also use ElevenLabs ASR and Conversational AI.

ElevenLabs is the **default text-to-speech provider** in FirstByte Voice. When you build a cascaded agent (speech-to-text → language model → text-to-speech) and do not override the voice stage, the runtime synthesizes replies with ElevenLabs. You can also use your ElevenLabs key for streaming speech-to-text and for a full Conversational AI agent. All three surfaces connect through the same per-tenant credential.

This page shows the config. The integration is shipped and in production.

> **NOTE:**
> If you are new to the runtime, start with [BYO ASR / LLM / TTS](/modalities/voice/runtime/byo-asr-llm-tts). That page shows the full cascade config file. This page shows only the ElevenLabs part.

## Use ElevenLabs for text-to-speech

This is the common case. Keep your speech-to-text and language model. Let ElevenLabs speak the replies.

1. **Set the TTS stage in agent-config.yml**
Set `tts_provider: elevenlabs`. Put your ElevenLabs `voice_id` in `tts_voice`. ElevenLabs is the default, thus you can omit `tts_provider`. But a named provider keeps the config explicit.

```yaml agent-config.yml
name: support-agent
pipeline_mode: cascaded

asr_provider: deepgram
asr_model: nova-2

llm_provider: openai
llm_model: gpt-4o-mini

# --- Text-to-speech: ElevenLabs (default) ---
tts_provider: elevenlabs
tts_voice: <elevenlabs-voice-id>   # your ElevenLabs voice_id

language: en
system_prompt: >
  You are a friendly support agent for Acme. Keep replies short and spoken-friendly.
```

2. **Add your ElevenLabs key**
Provider keys are per-tenant. Set `ELEVENLABS_API_KEY` in the FirstByte console at `agent.firstbyte.fast`. The control plane seals the key at rest and injects it at call setup. The key is never stored in the config file. See [Credentials](#credentials).

3. **Save and place a test call**
The control plane hydrates the config with no rebuild. Place a call. Check the [latency breakdown](/modalities/voice/observability/latency-breakdown). The TTS row shows time-to-first-audio for the ElevenLabs stage.

### How it streams

The ElevenLabs TTS session opens a **streaming** connection (`/stream-input`). Audio starts to flow as the language model's text arrives, not after the full sentence is generated. This keeps first-audio low. The default model is a low-latency turbo model. The synthesizer requests linear PCM. The runtime resamples the PCM into its **8 kHz PCM16** call bus for you.

> **NOTE:**
> A streaming session can fail to open because of a missing voice or a bad key. In that case the runtime falls back to a one-shot HTTP synthesis for that turn. The caller hears a reply and not silence. Check the voice id and the key before you go live to stay on the streaming path.

> **TIP:**
> `tts_voice` is your ElevenLabs `voice_id` (the long id from your ElevenLabs voice library). It is **not** the display name. Leave it empty to use the provider's default voice.

## Use ElevenLabs for speech-to-text

The same ElevenLabs key also enables a streaming speech-to-text stage. Set `asr_provider: elevenlabs` to transcribe with ElevenLabs instead of the default:

```yaml agent-config.yml
asr_provider: elevenlabs

tts_provider: elevenlabs
tts_voice: <elevenlabs-voice-id>
```

> **NOTE:**
> Deepgram is the recommended default transcriber for English telephony (see [Deepgram](/modalities/voice/integrations/deepgram)). Use ElevenLabs ASR when you want one vendor and one key across the listening and speaking stages.

## Use ElevenLabs Conversational AI

ElevenLabs Conversational AI (ConvAI) is a full duplex agent. ElevenLabs owns transcription, the language model, and the voice on one bidirectional connection. The runtime bridges the call audio to that connection. Configure ConvAI as a single `REALTIME` node, in the same way as the other [speech-to-speech providers](/modalities/voice/runtime/byo-speech-to-speech):

```yaml agent-config.yml
entry_node: REALTIME
pipeline:
  REALTIME:
    node_type: REALTIME
    provider: elevenlabs
    model: <elevenlabs-agent-id>   # required: your ElevenLabs Conversational AI agent id
    voice: <voice-id>              # optional: override the agent's configured voice
    instructions: |               # optional: override the agent's system prompt
      You are a friendly support agent for Acme. Keep replies short.
```

- **`model`** (`string`, required) — Your ElevenLabs Conversational AI **agent id**. This field is mandatory. ConvAI dials a specific pre-built ElevenLabs agent, not a bare model name.

- **`voice`** (`string`) — Overrides the voice configured on the ElevenLabs agent. Leave empty to use the agent's own voice.

- **`instructions`** (`string`) — Overrides the agent's system prompt for this call. Leave empty to use the prompt set in ElevenLabs.

> **NOTE:**
> **Public vs. private agents.** A public ElevenLabs agent connects without an API key. A private agent needs `ELEVENLABS_API_KEY` in the tenant's credentials.

> **WARNING:**
> ConvAI's in-call **tool / function calling** is more limited than OpenAI Realtime. If your agent must call HTTP or MCP tools mid-conversation, use a [cascade](/modalities/voice/runtime/byo-asr-llm-tts) or [OpenAI Realtime](/modalities/voice/integrations/openai-realtime). In a cascade, the LLM stage runs [tool calling](/modalities/voice/runtime/tool-calling).

## Credentials

One key covers all three surfaces (TTS, ASR, ConvAI). Set the key in the FirstByte console at `agent.firstbyte.fast`. The control plane resolves the key at call setup and seals it at rest.

For single-tenant or local development, the runtime also reads the key from the environment as a fallback:

```bash
export ELEVENLABS_API_KEY=...
```

> **WARNING:**
> If the TTS (or ASR) stage has no usable ElevenLabs key, the runtime refuses the agent at session creation with a clean error. The agent does not start and then fail mid-call. Check that the key is present before you route live traffic.

## Next steps

- **[Full cascade config](/modalities/voice/runtime/byo-asr-llm-tts)** — Wire ElevenLabs TTS alongside your chosen ASR and LLM in one config file.
- **[Speech-to-speech](/modalities/voice/runtime/byo-speech-to-speech)** — Run ConvAI or another duplex model as a single REALTIME node.
- **[Turn detection](/modalities/voice/concepts/turn-detection)** — Tune barge-in and backchannel handling around the ElevenLabs voice.
- **[Latency breakdown](/modalities/voice/observability/latency-breakdown)** — See TTS time-to-first-audio on a live call.
