Compatibility
OpenAI compatibility
POST /v1/audio/speech accepts the OpenAI audio.speech request shape. Same gateway, same wallet, same response headers — only the field names differ, so switching is a base-URL change.
from openai import OpenAI client = OpenAI( base_url="https://api.vocalix.ai/v1", # the only change api_key="vx_live_…", ) audio = client.audio.speech.create( model="echo-1", voice="anika-hi", input="आपका parcel आज शाम तक deliver हो जाएगा।", response_format="wav", ) audio.stream_to_file("reply.wav")
Field mapping
| OpenAI shape | Native shape |
|---|---|
| input | text |
| voice | voice_id |
| response_format | output_format |
| model | model |
| speed | speed |
response_format is expanded for you
OpenAI names a container; the native surface wants a container and a rate. These are the mappings applied server-side — but only two of them reach a backend that can encode the result.
| response_format | Native | Today |
|---|---|---|
| wav | wav_22050 | audio |
| pcm | pcm_24000 | audio |
| mp3 | mp3_44100_128 | 400 |
| opus | opus_24000 | 400 |
| aac | aac_44100 | 400 |
| flac | flac_44100 | 400 |
●Set response_format explicitly. OpenAI defaults to mp3, and the synthesis backend returns PCM — it does not encode mp3, opus, aac or flac yet, so those come back as 400 invalid_request naming the formats that do work. Pass response_format="wav" and the rest of a drop-in migration is genuinely just the base URL.
✓ same X-Vocalix-* response headers✓ same wallet and rate sheet✓ seed has no OpenAI equivalent — use the native shape