How do I create a pronunciation dictionary?
# support
s
/help I want to use the APi reference. However, I get a 400 error when I try to create one for ElevenLabs. How do I create an API request using the following code? I need step-by-step instructions. POST https://api.vapi.ai/provider/11labs/pronunciation-dictionary Content-Type: application/json Authorization: Bearer YOUR_API_KEY { "name": "Custom FICA Pronunciation", "rules": [ { "stringToReplace": "FICA", "type": "phoneme", "phoneme": "/ˈfaɪkə/", "alphabet": "ipa", "caseSensitive": true } ] }
c
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
s
Here is the error code: "message": "Unsupported data type. Either file or rules must be provided.", "error": "Bad Request", "statusCode": 400 } Also, please note that I am using the Vapi API reference. https://cdn.discordapp.com/attachments/1453080975318843436/1455568135972458655/Screenshot_2025-12-30_at_8.27.37_a.m..png?ex=695532f6&is=6953e176&hm=aede6818d37cd5142d7bdc862a2f50e84037ea2db7bba6643efc33ac5215e440&
c
Thanks for getting back to us and updating us We’ll share an update as soon as more information becomes available. We appreciate your understanding and patience as we continue our investigation.