Voice agents VAPI

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.

1

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:

StepWhat happens
1 · Text conversion triggerDuring a conversation, VAPI needs to convert text to speech.
2 · Request to MunsitVAPI sends a POST request to Munsit's TTS endpoint with text and audio specifications.
3 · Audio generationMunsit generates Arabic audio and returns it as raw PCM data.
4 · Real-time playbackVAPI streams the audio to the caller in real time.
2

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.

Your API key will only be displayed once. Copy it securely before closing the dialog. Store keys in VAPI Custom Credentials — never hardcoded in assistant configuration — use separate credentials for dev and production, and rotate periodically.

Then create a Server Configuration at VAPI Custom Credentials"Create New Server Configuration", with these exact settings:

FieldValue
NameA descriptive name, e.g. "Munsit TTS"
Authentication TypeBearer Token
TokenYour Munsit API key
Include BearerDisable this toggle (turn it OFF)
Header Namex-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.

3

The endpoint URL

The Munsit TTS endpoint URL encodes the model, voice, and tuning in its path and query string:

URL structure
https://api.munsit.com/api/v1/integrations/vapi/{model_id}/{voice_id}?similarity={similarity}&speed={speed}
ParameterTypeDescriptionExample
model_idstringThe Munsit model to use — faseeh-v1-preview (Faseeh), high-quality Arabic voice synthesis.faseeh-v1-preview
voice_idstringThe Arabic voice identifier. Browse and verify IDs in the Voice Library — they're case-sensitive.ar-najdi-male-2
similaritynumberVoice 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
speednumberSpeech speed multiplier, 0.7–1.2 (default 1.0). Below 1.0 slows down, above 1.0 speeds up.1.0
example URLs
// Full model with Najdi male voice "url": "https://api.munsit.com/api/v1/integrations/vapi/faseeh-v1-preview/ar-najdi-male-2?similarity=0.7&speed=1.0" // Faseeh with UAE female voice "url": "https://api.munsit.com/api/v1/integrations/vapi/faseeh-v1-preview/ar-uae-female-1?similarity=0.8&speed=1.0" // Full model with Hijazi male voice (slower speech) "url": "https://api.munsit.com/api/v1/integrations/vapi/faseeh-v1-preview/ar-hijazi-male-1?similarity=0.75&speed=0.9"
4

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.

assistant configuration
{ "name": "Munsit Assistant 2", "voice": { "provider": "custom-voice", "server": { "url": "https://api.munsit.com/api/v1/integrations/vapi/faseeh-v1-preview/ar-najdi-male-2?similarity=0.7&speed=1.0", "credentialId": "d4a3a362-fe82-4255-b475-f30eefe8e75c", "timeoutSeconds": 30 }, "fallbackPlan": { "voices": [ { "provider": "eleven-labs", "voiceId": "21m00Tcm4TlvDq8ikWAM" } ] } } }
5

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.

VAPI request
{ "message": { "type": "voice-request", "text": "مرحباً، كيف يمكنني مساعدتك اليوم؟", "sampleRate": 24000, "timestamp": 1677123456789, "call": { "id": "call-123", "orgId": "org-456" }, "assistant": { "id": "assistant-789", "name": "Munsit Assistant" }, "customer": { "number": "+1234567890" } } }

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.

Munsit handles all audio format requirements automatically. No additional configuration needed.
6

Test the integration

Use VAPI's API to create a test call that exercises your Munsit TTS assistant end to end.

javascript
async function testFaseehWithVAPICall() { const vapiApiKey = 'your-vapi-api-key'; const assistantId = 'your-assistant-id'; // Assistant with Munsit TTS const callData = { assistant: { id: assistantId }, phoneNumberId: 'your-phone-number-id', customer: { number: '+1234567890' }, // Your test number }; try { const response = await fetch('https://api.vapi.ai/call', { method: 'POST', headers: { Authorization: `Bearer ${vapiApiKey}`, 'Content-Type': 'application/json', }, body: JSON.stringify(callData), }); const call = await response.json(); console.log('Test call created:', call.id); return call; } catch (error) { console.error('Failed to create test call:', error); } }
7

Troubleshooting

Symptoms, likely causes, and what to change.

SymptomCommon causesSolutions
Request timeouts — VAPI doesn't receive audio, calls may dropNetwork issues between VAPI and the Munsit API; TTS takes longer than the timeout; server overloadIncrease timeoutSeconds (default 30); check network and Munsit API status
Audio playback problems — no audio, or distorted/garbled soundIncorrect URL format or parameters; invalid voice ID; authentication issuesVerify 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 UnauthorizedInvalid Munsit key in custom credentials; missing/incorrect credential ID; key expired or revokedVerify the key at app.munsit.com; check the credential ID against the VAPI dashboard; regenerate if needed
High latency — noticeable delays in conversationNetwork latency; high similarity values requiring more processingReduce similarity (e.g. 0.9 → 0.7); consider geographic proximity of services
Invalid voice ID — 404 Not FoundTypo; voice doesn't exist; wrong model/voice combinationVerify IDs in the Voice Library — exact and case-sensitive — and check the voice is available for your model
8

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.