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

# Vapi

> Use Kova TTS as a custom voice in your Vapi assistants.

[Vapi](https://vapi.ai) is a platform for building voice agents. Kova plugs in as a **custom voice**: Vapi sends each utterance to a Kova endpoint and plays back the audio Kova returns.

## Configure your assistant

Set your assistant's `voice` to Vapi's `custom-voice` provider, pointed at the Kova Vapi endpoint with your chosen voice and API key.

```json theme={null}
{
  "voice": {
    "provider": "custom-voice",
    "server": {
      "url": "https://api.kova.ai/v1/tts/integrations/vapi?voice=cal",
      "headers": {
        "x-api-key": "kova_sk_your_key_here"
      }
    }
  }
}
```

* **`url`**: the Kova Vapi endpoint. Set the `voice` query parameter to any speaker id from [`/v1/tts/speakers`](/voices) (for example `cal`).
* **`headers.x-api-key`**: your Kova API key from [platform.kova.ai](https://platform.kova.ai/dashboard/api-keys). Vapi sends it on every request; Kova validates and bills it.

<Note>Each Vapi voice maps to one Kova speaker. To offer multiple voices, create one custom-voice config per speaker, changing the `voice` query parameter.</Note>

## How it works

Vapi POSTs a `voice-request` for each utterance:

```json theme={null}
{ "message": { "type": "voice-request", "text": "Hello from Kova.", "sampleRate": 24000 } }
```

Kova synthesizes the text and returns raw 16-bit mono little-endian PCM at the requested sample rate, which Vapi streams into the call. Supported sample rates: 8000, 16000, 22050, and 24000 Hz.

## Billing and errors

Usage is billed to the API key in the `x-api-key` header, the same as direct API calls. An invalid key returns 401; an account out of credits returns 402. Top up at [platform.kova.ai/dashboard/billing](https://platform.kova.ai/dashboard/billing).
