Public API v1

Vapi custom-voice webhook (raw PCM for voice agents)

Point 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. Billed per submitted character like the rest of /v1, and refunded if the audio is cut short.

post/api/v1/vapi/speech

Query parameters

voiceIdstring

Preset voice id; omit for the engine default.

engine'v3' | 'v4'

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

No recorded changes to this endpoint across all 1 revision of this API.