> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turncall.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Providers

> Configure STT, LLM, and TTS providers per agent

TurnCall supports multiple providers for each stage of the voice pipeline. Configure them per-agent.

## Provider Matrix

| Role    | Providers                                                                                                                                                      |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **STT** | `deepgram` (default, streaming), `openai`, `elevenlabs`, `cartesia` (Ink, streaming)                                                                           |
| **LLM** | `openai` (default), `anthropic` (Claude), `ollama` (local), `custom_openai` (any OpenAI-compatible), `openrouter` (multi-model + fallback routing, voice only) |
| **TTS** | `deepgram` (default), `openai`, `elevenlabs`, `cartesia` (Sonic-3, streaming, 60+ emotions)                                                                    |
| **S2S** | `openai` (Realtime API — optional `base_url` targets an OpenAI-Realtime gateway like Vercel AI Gateway / LiteLLM / xAI, e.g. Grok), `google` (Gemini Live)     |

## STT Configuration

<CodeGroup>
  ```json Deepgram (default) theme={null}
  "stt": {"provider": "deepgram", "model": "nova-2", "language": "en"}
  ```

  ```json OpenAI Whisper theme={null}
  "stt": {"provider": "openai", "model": "whisper-1"}
  ```

  ```json ElevenLabs Scribe theme={null}
  "stt": {"provider": "elevenlabs"}
  ```

  ```json Cartesia Ink theme={null}
  "stt": {"provider": "cartesia"}
  ```
</CodeGroup>

## LLM Configuration

<CodeGroup>
  ```json OpenAI (default) theme={null}
  "llm": {"provider": "openai", "model": "gpt-4o-mini"}
  ```

  ```json Anthropic Claude theme={null}
  "llm": {"provider": "anthropic", "model": "claude-sonnet-4-20250514"}
  ```

  ```json Ollama (local) theme={null}
  "llm": {"provider": "ollama", "model": "gemma3:12b"}
  ```

  ```json Custom OpenAI-compatible theme={null}
  "llm": {
    "provider": "custom_openai",
    "model": "meta-llama/Llama-3-70b",
    "base_url": "https://api.together.xyz/v1",
    "api_key": "your-key"
  }
  ```

  ```json OpenRouter (model fallback) theme={null}
  "llm": {
    "provider": "openrouter",
    "model": "anthropic/claude-3.5-sonnet",
    "fallback_models": ["openai/gpt-4o", "google/gemini-flash-1.5"]
  }
  ```
</CodeGroup>

<Note>
  **OpenRouter** routes through [openrouter.ai](https://openrouter.ai) with automatic failover — if the primary model rate-limits or errors mid-call, it falls over to the next model in `fallback_models`. Voice only (WebRTC / Twilio / WhatsApp voice); not supported on the SMS/Chat text path. The model that answered each turn is recorded on `transcript.final` events.
</Note>

### LLM Options

| Field             | Required            | Description                                                       |
| ----------------- | ------------------- | ----------------------------------------------------------------- |
| `provider`        | Yes                 | `openai`, `anthropic`, `ollama`, `custom_openai`, or `openrouter` |
| `model`           | Yes                 | Model name                                                        |
| `base_url`        | For `custom_openai` | OpenAI-compatible API base URL                                    |
| `api_key`         | No                  | API key for `custom_openai` (masked in responses)                 |
| `fallback_models` | For `openrouter`    | Ordered list of fallback models (voice only)                      |
| `temperature`     | No                  | 0.0–2.0 (default: 0.7)                                            |
| `max_tokens`      | No                  | 1–128000 (default: 1024)                                          |

## TTS Configuration

<CodeGroup>
  ```json Deepgram (default) theme={null}
  "tts": {"provider": "deepgram", "voice": "aura-2-helena-en"}
  ```

  ```json OpenAI theme={null}
  "tts": {"provider": "openai", "voice": "alloy"}
  ```

  ```json ElevenLabs theme={null}
  "tts": {"provider": "elevenlabs", "voice": "rachel"}
  ```

  ```json Cartesia Sonic theme={null}
  "tts": {"provider": "cartesia", "voice": "sonic-english-female"}
  ```
</CodeGroup>

## Required API Keys

| Provider              | Environment Variable         |
| --------------------- | ---------------------------- |
| Deepgram              | `DEEPGRAM_API_KEY`           |
| OpenAI                | `OPENAI_API_KEY`             |
| Anthropic             | `ANTHROPIC_API_KEY`          |
| ElevenLabs            | `ELEVENLABS_API_KEY`         |
| Cartesia              | `CARTESIA_API_KEY`           |
| Google (Gemini)       | `GOOGLE_API_KEY`             |
| OpenRouter            | `OPENROUTER_API_KEY`         |
| HeyGen (video avatar) | `HEYGEN_LIVE_AVATAR_API_KEY` |
| Tavus (video avatar)  | `TAVUS_API_KEY`              |

<Info>
  Ollama requires no API key — just install it locally and run `ollama pull <model>`.
</Info>
