Endpoints
/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
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
text, plus the duration or token usage the provider reports.
Parameters the gateway changes or refuses
Request and response headers
TheX-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 standardgen_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.