OPENAI_BASE_URL at the gateway and its OPENAI_API_KEY at a LangWatch virtual key. Voice traffic gets the same governance as chat: virtual-key auth, model allowlists, budgets, rate limits, and per-call observability.
Two providers ship today:
Configure the provider key once in Settings → Model Providers (OpenAI and ElevenLabs both take a plain API key); every virtual key routed to that provider can then call its voice models.
Text to speech
voice field.
Content-Type (audio/mpeg, audio/wav, audio/pcm, …) with no JSON envelope, exactly like OpenAI, so client.audio.speech.create(...) consumes it unchanged. response_format: "pcm" returns raw PCM16 for realtime consumers.
Transcription
file part plus model, and optionally language, prompt, response_format, temperature. Uploads are capped at 25 MB (matching OpenAI’s own limit); larger uploads get a 413 before any provider is contacted.
text, plus whatever the provider reports (duration, segments, token usage).
Observability and cost measures
Every audio call lands as a gateway trace like chat does. Providers that report token usage (gpt-4o-mini-tts, gpt-4o-transcribe) fill the standard gen_ai.usage.* token attributes; character- and duration-priced providers are measured by two audio-specific attributes:
Errors
Same error surface as every other endpoint; see Errors. Provider rejections (an invalid ElevenLabs voice id, an unsupported format) pass through with the provider’s own status code and body. A model outside the virtual key’s allowlist returns the standardmodel_not_allowed; a provider with no key configured returns no_provider_configured.
Not yet supported
- Streaming TTS/STT (
stream=true): requests are served complete; streaming is a follow-up. - Realtime voice websockets (OpenAI Realtime, ElevenLabs ConvAI): connect directly to the provider for realtime sessions; the gateway serves the request/response audio endpoints.