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="meera-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.
| mp3 | mp3_44100_128 |
| opus | opus_24000 |
| aac | aac_44100 |
| flac | flac_44100 |
| wav | wav_22050 |
| pcm | pcm_24000 |
✓ same X-Vocalix-* response headers✓ same wallet and rate sheet✓ pitch and seed have no OpenAI equivalent — use the native shape