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

# Fallback Models

> Keep calls going when a speech-to-text, LLM or text-to-speech provider fails: give a Bolna voice agent a list of fallback models over the API, and see on each execution what served and why.

A provider can fail in the middle of a call: a rate limit, an outage, a key that stops working. With fallbacks, the call moves to the next model you listed for that component and carries on, instead of going silent or ending.

You set fallbacks per component, on the transcriber (speech-to-text), the synthesizer (text-to-speech) and the LLM. They are configured over the API; the dashboard does not show them yet.

***

## Where they go

Each component takes a `fallbacks` list, tried in order:

```json theme={"system"}
{
  "agent_config": {
    "tasks": [
      {
        "tools_config": {
          "transcriber": {
            "provider": "deepgram",
            "model": "nova-3",
            "language": "en",
            "fallbacks": [
              { "provider": "sarvam", "model": "saaras:v3" }
            ]
          },
          "synthesizer": {
            "provider": "elevenlabs",
            "provider_config": { "voice_id": "...", "model": "eleven_turbo_v2_5" },
            "fallbacks": [
              { "provider": "cartesia", "provider_config": { "voice_id": "...", "model": "sonic-3" } }
            ]
          },
          "llm_agent": {
            "agent_type": "simple_llm_agent",
            "agent_flow_type": "streaming",
            "llm_config": {
              "provider": "openai",
              "model": "gpt-4.1-mini",
              "fallbacks": [
                { "provider": "azure", "model": "azure/gpt-4.1-mini" }
              ]
            }
          }
        }
      }
    ]
  }
}
```

| Component | Each entry is | Notes |
| - | - | - |
| `transcriber.fallbacks` | A transcriber: `provider`, `model` and any of its usual fields. | `language` is optional: the entry is given the agent's language in the format its provider expects. |
| `synthesizer.fallbacks` | A voice: `provider` and `provider_config`, as for the agent's own voice. | A fallback voice speaks in your agent's language; pick one that supports it. |
| `llm_agent.llm_config.fallbacks` | `provider` and `model`, optionally `reasoning_effort` and `verbosity` for reasoning models. | Every other LLM setting (prompt, temperature, max tokens, tools) stays the agent's own. Supported for simple, knowledge-base and graph agents. |

A fallback entry cannot have fallbacks of its own.

***

## When a call moves to a fallback

* **LLM**: when a reply fails before any of it is spoken, the turn is re-run on the next model. A network or server error that comes back within a second and a half gets one more try on the same model first; a slower one, a rate limit, an authentication error or a missing model moves straight on. A reply the caller has already started hearing is never re-run.
* **Speech-to-text**: when the provider's connection fails. A connection that was working gets one reconnect first; one that never connects moves straight on. What the caller said while it was down is passed to the fallback.
* **Text-to-speech**: when the voice fails or cannot connect. The fallback voice speaks the interrupted reply from its start.

Once a component moves, it stays on that fallback for the rest of the call. If every entry fails, the call ends as it would with no fallbacks.

On a graph agent, a node can use its own model. When that model fails, the whole call moves to the agent's fallback list, on every node, for the rest of the call. The model that picks the next node is not covered by fallbacks; if it fails, the call stays on its current node.

***

## Multilingual agents

With [`multilingual_config`](https://www.bolna.ai/docs/customizations/multilingual-config-reference):

* **Speech-to-text**: `transcriber.fallbacks` on the agent apply to every language, each in that language. `languages.<code>.transcriber.fallbacks` replaces them for one language.
* **Text-to-speech**: each language sets its own in `languages.<code>.synthesizer.fallbacks`. The agent-level `synthesizer.fallbacks` cover the main language (`active_language`) only.
* **LLM**: one list for the whole call, in `llm_agent.llm_config.fallbacks`.

```json theme={"system"}
"multilingual_config": {
  "enabled": true,
  "active_language": "en",
  "languages": {
    "en": { "synthesizer": { "provider": "elevenlabs", "provider_config": { "voice_id": "..." } } },
    "hi": {
      "transcriber": {
        "language": "hi",
        "fallbacks": [{ "provider": "sarvam", "model": "saaras:v3" }]
      },
      "synthesizer": {
        "provider": "sarvam",
        "provider_config": { "voice_id": "anushka", "model": "bulbul:v3" },
        "fallbacks": [{ "provider": "elevenlabs", "provider_config": { "voice_id": "..." } }]
      }
    }
  }
}
```

***

## Checks when you save

Fallbacks are held to the same checks as the models they stand in for, on create and on every update:

* A retired model, an unknown voice or an out-of-range setting is refused, as for the agent's own.
* A speech-to-text fallback must offer the agent's language (each language's, on a multilingual agent): `Transcriber fallback '<provider>' model '<model>' is not available for language '<code>'.`
* A custom TTS cannot be a fallback voice: `Custom TTS isn't supported as a fallback voice yet.`
* An LLM fallback must be on `openai`, `azure`, `bedrock`, `sarvam`, `custom` or Bolna's hosted models: `LLM fallback provider '<provider>' is not supported as a fallback.`
* A fallback no Bolna region can serve alongside the rest of the agent is refused, as the same pairing would be for the agent's own models.

When a call starts, a fallback the call's region cannot serve is left out for that call.

***

## Keys and billing

* A fallback runs on your own key for its provider when you have connected one, and on Bolna's otherwise. It never uses the key of the provider it stands in for.
* How a fallback is charged follows how the call is billed:
  * **Flat per-minute rate** (your agent's models are all [preferred models](https://www.bolna.ai/docs/pricing/preferred-models.md)): the call is charged at that rate whatever served it.
  * **Plan:** each component your plan covers is charged at the plan's rate whatever served it. The other components follow the usage-based rules below.
  * **Usage-based rates:** the call is charged as if your agent's own models served all of it: fallback LLM tokens at your agent's model rate (or the fallback's own rate if your agent's model has none), fallback voice characters at your agent's voice rate, and speech-to-text minutes at your agent's rate. Two exceptions:
    * A fallback on Bolna's key that stands in for a provider on your own key or endpoint is charged at the fallback's own usage-based rate, since Bolna does not charge for a component on your own key.
    * Usage a fallback served on your own key is not charged.

***

## What you see on the execution

Each fallback that served appears in `usage_breakdown.fallback_usage` on the [execution](https://www.bolna.ai/docs/api-reference/executions/get_execution.md) and in your webhook payload:

```json theme={"system"}
"fallback_usage": [
  {
    "component": "llm",
    "provider": "azure",
    "model": "azure/gpt-4.1-mini",
    "reason": "http_429",
    "usage": { "input_tokens": 4210, "output_tokens": 188, "cached_tokens": 0, "turns": 9 }
  }
]
```

| Field | Description |
| - | - |
| `component` | `llm`, `transcriber` or `synthesizer`. |
| `provider`, `model` | The fallback that served. |
| `reason` | Why the call moved: `http_<status>` for an LLM error code, or the error's name when it has no code (for example `APIConnectionError`), or `connection_error` for speech-to-text and text-to-speech. |
| `usage` | What the fallback served for the rest of the call: `input_tokens`, `output_tokens`, `cached_tokens` and `turns` for an LLM, `audio_s` for speech-to-text, `characters` for text-to-speech. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.