Vapi custom-voice webhook (raw PCM for voice agents)
Changed onPoint a Vapi assistant's custom-voice provider at this URL to give it a Vietnamese voice. Vapi POSTs {message: {type: "voice-request", text, sampleRate}} and expects raw mono 16-bit little-endian PCM at exactly that rate — which is what this returns, streamed as it is generated. Authenticate by putting your VieNeu API key in the assistant's server.secret; Vapi sends it as X-VAPI-SECRET. Choose the voice with ?voiceId= on the URL (and ?engine= for v4), since Vapi's payload has no field for it. AI refinement is never applied here: an agent needs the reply to start, not an extra model round-trip. Your pronunciation dictionary is applied (?applyPronunciation=false turns it off). Billed per submitted character like the rest of /v1, and refunded if the audio is cut short.
Request
- Base URLhttps://api.vieneu.io
- Auth
- API key in header X-API-Key
- or HTTP bearer
- or API key in header X-VAPI-SECRET
Query parameters
Preset voice id or display name (name in GET /v1/voices); omit for the engine default.
Read the text through your account's pronunciation dictionary — the rules saved at https://vieneu.io/#/pronunciation (Từ điển phát âm). Defaults to TRUE, and changes nothing until you have saved rules there. The rules run after aiRefine and before synthesis; you are billed for the text you sent, and that is the text kept with the job. Set false to read this request as written. If your rules make the text longer than the request limit, or more than twice as long plus 1,000 characters, the call is refused with 400 PRONUNCIATION_EXPANDED_TOO_LONG, uncharged. Vapi's payload has no field for it, so it goes on the URL: false (or 0/off/no) turns it off.
Request body
Example request
{
"message": {
"type": "voice-request",
"text": "Xin chào, tôi có thể giúp gì cho bạn?",
"sampleRate": 24000
}
}Response
Raw mono 16-bit little-endian PCM at exactly the sampleRate Vapi asked for, streamed as it is generated. Headerless — the rate is the one you sent.
Changes
- info
added the new optional
queryrequest parameterapplyPronunciation
- info
- breaking
removed the enum value
v3from thequeryrequest parameterengine
- breaking