Endpoint
model and stream, resolves the model through the virtual key, and sends the request to the provider that serves it.
Point any OpenAI SDK at the gateway: set the base URL to https://gateway.langwatch.ai/v1 and the API key to the virtual key. The key also works in an x-api-key header.
Request
Response
extra_fields.params_dropped.
Parameters the gateway changes or refuses
Request headers the gateway reads
Response headers
Non-streaming calls that run long receive a single space character before the JSON body at each keep-alive interval. JSON parsers skip it.
Streaming
Set"stream": true. The response is text/event-stream, one data: frame per chunk, ending with data: [DONE]:
event: errorwith a JSON object when the stream fails after it opened. See Errors.event: warningwith{"warning":"provider_did_not_report_usage_on_stream"}when the stream ended with no usage from the provider.
extra_fields.params_dropped on the final usage-bearing chunk.
Errors
The gateway answers with the envelope on Errors. Codes this endpoint raises before the provider is called:
A provider’s own error is forwarded with the provider’s status and body, under
X-LangWatch-Provider.
Also check: Streaming, Model aliases, Budgets.