Hi SKoess,
Follow these steps to create the pronunciation dictionary via the API and troubleshoot the 400:
1. Prepare your API key
- Get your Vapi API key from Dashboard (Dashboard → API Keys).
- Use it exactly as: Authorization: Bearer YOUR_API_KEY
2. Validate request JSON
- Use this minimal valid body (remove extra fields if 400 persists):
{
"name": "Custom FICA Pronunciation",
"rules": \[
{
"stringToReplace": "FICA",
"type": "phoneme",
"phoneme": "/ˈfaɪkə/",
"alphabet": "ipa"
}
\]
}
- Note: the docs example does not require "caseSensitive". If you need case-sensitive rules, add it but try without first.
3. CURL example (replace YOUR_API_KEY):
curl -X POST "https://api.vapi.ai/provider/11labs/pronunciation-dictionary"
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"name":"Custom FICA Pronunciation",
"rules":\[{"stringToReplace":"FICA","type":"phoneme","phoneme":"/ˈfaɪkə/","alphabet":"ipa"}\]
}'
4. Common causes of 400 and quick fixes
- Malformed JSON: run through a JSON linter or use the single-line curl payload above.
- Missing or wrong Authorization header: ensure no trailing spaces, “Bearer ” prefix, and correct key.
- Invalid field names/values: ensure "type" is "phoneme", "alphabet" is "ipa" (lowercase).
- If using BYOK ElevenLabs flow: 400 can occur if ElevenLabs phoneme rules aren’t allowed for your model — phoneme rules require an ElevenLabs-compatible model when used in TTS (but dictionary creation should still succeed).
5. If you get a 400 response, capture and share:
- Full HTTP response body (error message)
- The exact curl/HTTP client command you used
- Whether you're using Vapi's ElevenLabs integration or your own ElevenLabs API key (BYOK)
Reference: Pronunciation dictionaries docs:
https://docs.vapi.ai/assistants/pronunciation-dictionaries