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

# Vapi

> Use AirCaps Live 1 as the speech-to-text of a Vapi voice assistant, as a custom transcriber.

[Vapi](https://vapi.ai) is a platform for voice agents on phone and web calls. AirCaps AI hosts a connector at `vapi.aircaps.ai` that serves [AirCaps Live 1](https://aircaps.ai/docs/guides/live-1.md) to Vapi as a [custom transcriber](https://docs.vapi.ai/customization/custom-transcriber). There is nothing to install or run: you change your assistant's settings and keep everything else in Vapi.

The connector transcribes both sides of the call: the caller's speech, and the assistant's own speech, which Vapi uses for the conversation history. Turns end in one of two ways:

* **Vapi decides (default).** Vapi's own endpointing ends the caller's turn, using the transcripts AirCaps sends.
* **AirCaps decides.** Add AirCaps as the assistant's custom endpointing model, and AirCaps Live 1's end-of-turn detection tells Vapi when the caller has finished.

| | |
| - | - |
| Transcriber | `wss://vapi.aircaps.ai/vapi/transcriber` (Vapi provider `custom-transcriber`) |
| Endpointing | `https://vapi.aircaps.ai/vapi/endpointing` (Vapi provider `custom-endpointing-model`) |
| Model | `aircaps-live-1`: English |
| Authentication | Your AirCaps AI API key as a Bearer token, in the request headers |

## Prerequisites

* An AirCaps AI API key: sign in to the [AirCaps AI console](https://console.aircaps.ai), open **API keys** and create one. Use a key just for Vapi, so you can revoke it on its own.
* A Vapi assistant, and your Vapi private API key (Vapi dashboard, **API Keys**) to update it.

> [!NOTE]
>
> Each Vapi call holds **two** AirCaps Live 1 sessions: one for the caller and one for the assistant. Both are billed as AirCaps Live 1 audio. Accounts run **one session at a time by default**, which is not enough for a Vapi call: with one session, the caller is still transcribed, but the assistant no longer sees its own earlier replies. For Vapi, [talk to sales](https://aircaps.ai/contact) to get at least two sessions per call you run at the same time. See [Pricing and limits](https://aircaps.ai/docs/guides/live-1.md#pricing-and-limits).

## Setup

**1. Write the assistant settings**

Save this as `aircaps-vapi.json`, with your AirCaps AI API key in both places:

```json aircaps-vapi.json theme={null}
{
  "transcriber": {
    "provider": "custom-transcriber",
    "server": {
      "url": "wss://vapi.aircaps.ai/vapi/transcriber?end_of_turn_mode=balanced",
      "headers": { "Authorization": "Bearer YOUR_AIRCAPS_API_KEY" }
    }
  },
  "startSpeakingPlan": {
    "smartEndpointingPlan": {
      "provider": "custom-endpointing-model",
      "server": {
        "url": "https://vapi.aircaps.ai/vapi/endpointing",
        "headers": { "Authorization": "Bearer YOUR_AIRCAPS_API_KEY" },
        "timeoutSeconds": 2
      }
    }
  }
}
```

`transcriber` makes AirCaps Live 1 the assistant's speech-to-text. `startSpeakingPlan` lets AirCaps decide when the caller has finished; leave it out to keep Vapi's own endpointing. If your assistant already has `startSpeakingPlan` settings (such as `waitSeconds`), put them in the same object.

**2. Update the assistant**

Send the settings to [Vapi's update assistant API](https://docs.vapi.ai/api-reference/assistants/update):

```bash theme={null}
curl -X PATCH "https://api.vapi.ai/assistant/YOUR_ASSISTANT_ID" \
  -H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
  -H "Content-Type: application/json" \
  -d @aircaps-vapi.json
```

The same two objects work anywhere Vapi takes an assistant: a transient assistant in `POST /call`, a squad member, or an assistant override.

**3. Call it**

Call the assistant from the Vapi dashboard (**Talk to Assistant**) or its phone number. Ask a question, interrupt the answer, and pause mid-sentence to hear how turns end. The call log shows both sides of the conversation.

> [!WARNING]
>
> Put the key in `headers`, not in a Vapi custom credential (`credentialId`). Vapi does not send a credential's token when it connects to a custom transcriber, so the connector receives no key, refuses the connection, and the call ends at once with `custom-transcriber-failed`.

## Turn detection

### Vapi decides (default)

Without `startSpeakingPlan.smartEndpointingPlan`, Vapi's own endpointing decides when the caller is done, from the transcripts the connector sends. Vapi's `startSpeakingPlan` settings apply as usual. Use this mode when you already tune turns in Vapi.

### AirCaps decides

With the endpointing plan from the setup, Vapi asks the connector each time it is about to end the caller's turn. The connector answers from the same call's AirCaps Live 1 session: keep waiting while the caller's turn is still open, or reply now once AirCaps Live 1 has ended the turn. The model decides from what was said as well as from the pause.

Endpointing requests must carry the same AirCaps AI API key as the transcriber; they are answered only for that key's calls.

### End-of-turn settings

Set them as query parameters on the transcriber URL. A mode is a preset; start with `balanced`.

| Mode | Use it when |
| - | - |
| `min_latency` | The fastest reply matters most. Ends turns on short pauses, so it can cut in while someone is thinking |
| `balanced` (default) | Most voice agents |
| `max_accuracy` | Interrupting the speaker is costly (long answers, numbers, addresses). Waits longer to be sure |

Any setting given beside a mode overrides that one value.

| Parameter | Values | Meaning | `min_latency` | `balanced` | `max_accuracy` |
| - | - | - | - | - | - |
| `end_of_turn_threshold` | 0.2 to 0.9 | How sure the model must be that the turn is complete. Higher waits for more certainty | 0.3 | 0.5 | 0.6 |
| `min_turn_silence_ms` | 0 to 1000 | The shortest pause that can end a turn | 40 | 80 | 400 |
| `max_turn_silence_ms` | 0, or 500 to 5000 | The pause that always ends a turn. 0: no such cap | 2560 | 2560 | 2560 |
| `vad_threshold` | 0.3 to 0.9 | How sure the model's voice detector must be that it hears speech. Raise it for noisy lines | the same in every mode | | |

```text theme={null}
wss://vapi.aircaps.ai/vapi/transcriber?end_of_turn_mode=max_accuracy&min_turn_silence_ms=300
```

These settings shape the caller's turns in both modes: the connector sends the caller's final transcript when the model ends the turn.

## How it works

* Vapi streams the call's audio to the connector, the caller and the assistant on separate channels. The connector streams each side to AirCaps Live 1 in its own session, at the address with the lowest latency.
* **Caller:** interim transcripts while the caller speaks, which Vapi uses to detect interruptions, then one final transcript per turn.
* **Assistant:** final transcripts only. Vapi builds the assistant's side of the conversation from them: its earlier replies in the LLM's history, and the assistant's lines in the call log.
* A session that ends during the call (sessions last up to an hour) is reopened.
* The connector stores no audio or text. The AirCaps Live 1 sessions follow your account's [data settings](https://aircaps.ai/docs/data-privacy.md).

Not supported by AirCaps Live 1: languages other than English, and key terms. Vapi's channels already separate the caller from the assistant.

## Troubleshooting

| Issue | Cause | What to do |
| - | - | - |
| The call ends at once with `custom-transcriber-failed` | No key, or a wrong one, reached the connector | Put the key in `transcriber.server.headers` as `Authorization: Bearer ...`, not in a Vapi credential. Check that the key is active in the [console](https://console.aircaps.ai) |
| The assistant forgets what it said; the call log has no assistant lines | The assistant's AirCaps Live 1 session was refused: the account is at its session limit | Each call needs two sessions. [Talk to sales](https://aircaps.ai/contact) for more |
| A second call fails as soon as it starts | The account's AirCaps Live 1 sessions are all in use (1 at a time by default) | End the other call, or [talk to sales](https://aircaps.ai/contact) for more |
| Calls fail with an empty account | Free hours and credits are used up | Add credits in the console |
| The assistant answers before the caller has finished | Turns end on short pauses | Use `end_of_turn_mode=max_accuracy`, or raise `min_turn_silence_ms` |
| The assistant waits too long to answer | Turns wait for long pauses | Use `end_of_turn_mode=min_latency`. Without the endpointing plan, also check Vapi's `startSpeakingPlan` waits |
| AirCaps end of turn seems to do nothing | Vapi is not asking the connector | Check `startSpeakingPlan.smartEndpointingPlan`: provider `custom-endpointing-model`, the endpointing URL, and the same key in its `headers` |

## Resources

* [Vapi custom transcriber](https://docs.vapi.ai/customization/custom-transcriber) and [speech configuration](https://docs.vapi.ai/customization/speech-configuration): Vapi's side of these settings
* [AirCaps Live 1 guide](https://aircaps.ai/docs/guides/live-1.md): the model, its protocol, pricing and limits
* [Pipecat](https://aircaps.ai/docs/integrations/pipecat.md) and [LiveKit](https://aircaps.ai/docs/integrations/livekit.md): the same model in voice agent frameworks
* Problems: [contact support](https://console.aircaps.ai/support)


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