Endpoints
base_url="https://gateway.langwatch.ai" and the virtual key in place of the ElevenLabs key. The key goes in the xi-api-key header the SDK already sends.
The ElevenLabs key itself stays on the organization’s ElevenLabs model provider. An SDK that still sends it gets 401 invalid_api_key, because the gateway reads that header as a virtual key.
Both audio paths are served only by an ElevenLabs credential. A key that cannot reach ElevenLabs answers 400 model_provider_not_bound and no provider is called. There is no fallback to another provider.
Text to speech
The body is capped at 1 MB; over the cap:
413 payload_too_large.
Speech to text
Request and response headers
TheX-LangWatch-End-User-Id, X-LangWatch-Metadata and Traceparent request headers work as on Chat Completions.
Both audio paths return the same response headers as Chat Completions, plus ElevenLabs’ own response headers. A forwarded ElevenLabs error carries X-LangWatch-Provider: elevenlabs and the vendor’s Retry-After when it sent one.
Streaming
Neither audio path streams. The audio bytes and the transcript are returned complete.Post-call webhook
{model_provider_id} is the id of the ElevenLabs model provider row in Settings, Model Providers. Store the webhook secret from ElevenLabs on that same provider row, under ELEVENLABS_WEBHOOK_SECRET.
The route takes no virtual key. Each delivery authenticates itself: the gateway relays the raw bytes and the ElevenLabs-Signature header to LangWatch, which computes the HMAC with the provider’s stored secret and accepts a signature timestamp at most 30 minutes old.
What happens with a delivery:
Responses:
The webhook is the fast path. Two minutes after a mint, LangWatch also reads the conversation back from ElevenLabs by its own id, so a session bills even when no delivery arrives.