Skip to main content

Endpoints

Both take OpenAI’s request shape and are served by an OpenAI or an ElevenLabs credential, whichever the model resolves to. Any client that speaks OpenAI’s audio API works by pointing its base URL at the gateway and its API key at a virtual key. For ElevenLabs’ own paths (/v1/text-to-speech/{voice_id}, /v1/speech-to-text) and the post-call webhook, see ElevenLabs. For OpenAI Realtime and ElevenLabs Conversational AI, see Realtime voice.

Text to speech

The response body is the audio bytes, with no JSON envelope. Content-Type follows response_format: For an ElevenLabs model, put the ElevenLabs voice id in voice. pcm on ElevenLabs is requested as pcm_24000, which matches OpenAI’s raw PCM16 at 24 kHz.

Parameters the gateway changes or refuses

Transcription

The response is JSON with text, plus the duration or token usage the provider reports.

Parameters the gateway changes or refuses

Request and response headers

The X-LangWatch-End-User-Id, X-LangWatch-Metadata and Traceparent request headers work as on Chat Completions. Both routes return the same response headers as Chat Completions: X-LangWatch-Gateway-Version, X-LangWatch-Gateway-Request-Id, X-LangWatch-Fallback-Count, X-LangWatch-Budget-Warning, Traceparent, X-LangWatch-Heartbeat-Active, and X-LangWatch-Provider on a forwarded provider error. X-LangWatch-Handled-Error carries the error.code when the gateway wrote the error itself, and is removed from a forwarded provider response.

Streaming

Neither route streams. The audio bytes and the transcript are returned complete.

Metering

Providers that report token usage fill the standard gen_ai.usage.* token attributes on the trace. Character-priced synthesis and duration-priced transcription are measured by two attributes:

Errors

Codes these routes raise before the provider is called: missing_model, model_not_allowed, model_provider_not_bound, bad_request (all 400) and payload_too_large (413). A provider’s own error, for example an unknown voice id, is forwarded with its status and body. The full table is on Errors.
Last modified on September 6, 2026