Skip to main content
OpenAI-compatible audio endpoints. Any client that speaks OpenAI’s audio API (the official SDKs, LiveKit and Pipecat voice agents, Scenario’s voice testing harness) works with zero code change by pointing its 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

Body matches OpenAI’s speech schema. For ElevenLabs models, put the ElevenLabs voice id in the same voice field.
The response body is the raw audio bytes with the matching 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

Form matches OpenAI’s transcription schema: a 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.
The response is the standard JSON transcript with 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 standard model_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.