VAPI
Plug Munsit's Arabic text-to-speech into VAPI voice assistants as a custom voice provider — natural Arabic on phone calls, with VAPI's real-time performance intact. You need a Munsit account and a VAPI account with access to custom voice configuration.
How it works
VAPI's custom TTS system operates through a webhook pattern. There's no SDK to install — VAPI calls a Munsit endpoint directly, four steps per utterance:
| Step | What happens |
|---|---|
| 1 · Text conversion trigger | During a conversation, VAPI needs to convert text to speech. |
| 2 · Request to Munsit | VAPI sends a POST request to Munsit's TTS endpoint with text and audio specifications. |
| 3 · Audio generation | Munsit generates Arabic audio and returns it as raw PCM data. |
| 4 · Real-time playback | VAPI streams the audio to the caller in real time. |
Set up authentication
VAPI stores your Munsit key as a Custom Credential and attaches it to every TTS request. First, create a key in the Munsit dashboard: click "Generate New API Key", name it descriptively (e.g. "VAPI Integration"), and copy it immediately.
Then create a Server Configuration at VAPI Custom Credentials → "Create New Server Configuration", with these exact settings:
| Field | Value |
|---|---|
| Name | A descriptive name, e.g. "Munsit TTS" |
| Authentication Type | Bearer Token |
| Token | Your Munsit API key |
| Include Bearer | Disable this toggle (turn it OFF) |
| Header Name | x-api-key |
Save, then copy the configuration's Credential ID — a UUID like d4a3a362-fe82-4255-b475-f30eefe8e75c, shown next to the configuration name (or in the URL when viewing its details). You'll reference it from your assistant configuration.
The endpoint URL
The Munsit TTS endpoint URL encodes the model, voice, and tuning in its path and query string:
| Parameter | Type | Description | Example |
|---|---|---|---|
model_id | string | The Munsit model to use — faseeh-v1-preview (Faseeh), high-quality Arabic voice synthesis. | faseeh-v1-preview |
voice_id | string | The Arabic voice identifier. Browse and verify IDs in the Voice Library — they're case-sensitive. | ar-najdi-male-2 |
similarity | number | Voice similarity/stability, 0.0–1.0 (typically 0.5–0.9). 0.0–0.4 more expressive · 0.5–0.7 balanced (recommended) · 0.8–1.0 very consistent. Rules of thumb: customer service 0.7–0.8, professional 0.8–0.9, creative 0.5–0.6. | 0.7 |
speed | number | Speech speed multiplier, 0.7–1.2 (default 1.0). Below 1.0 slows down, above 1.0 speeds up. | 1.0 |
Configure your assistant
Point the assistant's voice at your Munsit URL, reference the Credential ID from step 2, and always configure a fallback voice provider so calls continue if the endpoint has issues. Replace the example Credential ID with your own.
On the wire
Every TTS request from VAPI arrives as a voice-request message; Munsit answers with raw streamed PCM. You don't have to build either side — this is what flows between them.
Required request fields: type (always "voice-request"), text (supports Arabic and mixed content), sampleRate (8000, 16000, 22050, or 24000 Hz), and timestamp (Unix milliseconds). The audio Munsit returns is raw PCM — no headers or containers — mono, 16-bit signed integer, little-endian, at the requested sample rate.
Test the integration
Use VAPI's API to create a test call that exercises your Munsit TTS assistant end to end.
Troubleshooting
Symptoms, likely causes, and what to change.
| Symptom | Common causes | Solutions |
|---|---|---|
| Request timeouts — VAPI doesn't receive audio, calls may drop | Network issues between VAPI and the Munsit API; TTS takes longer than the timeout; server overload | Increase timeoutSeconds (default 30); check network and Munsit API status |
| Audio playback problems — no audio, or distorted/garbled sound | Incorrect URL format or parameters; invalid voice ID; authentication issues | Verify the URL matches /vapi/{model_id}/{voice_id}?similarity={similarity}; confirm the voice ID exists; check the credential ID holds a valid Munsit key |
| Authentication failures — 401 Unauthorized | Invalid Munsit key in custom credentials; missing/incorrect credential ID; key expired or revoked | Verify the key at app.munsit.com; check the credential ID against the VAPI dashboard; regenerate if needed |
| High latency — noticeable delays in conversation | Network latency; high similarity values requiring more processing | Reduce similarity (e.g. 0.9 → 0.7); consider geographic proximity of services |
| Invalid voice ID — 404 Not Found | Typo; voice doesn't exist; wrong model/voice combination | Verify IDs in the Voice Library — exact and case-sensitive — and check the voice is available for your model |
Where next
Now that Munsit TTS is answering calls: try different voices, combine Munsit for Arabic with other providers for English, and watch usage in the dashboard.
Working with an AI assistant? Every page is available as Markdown: add .md to the URL, or send an Accept: text/markdown header. For the whole documentation in one request, point it at llms-full.txt; the page index is llms.txt. Or use Copy Page, top right.
