Every page in this section is generated from LangWatch’s OpenAPI 3.1 document, so what you read here is what the API accepts.
The OpenAPI document
Fetch the whole thing, unauthenticated:
One document covers every surface below, which is what you point a client generator, a Postman import, or an agent at. Self-hosted: same path on your own DNS.
Authentication
Most endpoints take a project API key:
Authorization: Bearer sk-lw-... works too. Some families need an organization API key instead, because they carry signing secrets and organization-wide data: webhook endpoints, gateway spend, and everything that provisions the organization itself, from the organization profile and its members through roles and role bindings. Create either kind under Settings > API Keys.
Two surfaces authenticate differently again. The SCIM 2.0 endpoints take a SCIM bearer token, because the caller is your identity provider. Creating organizations on a self-hosted instance takes the instance administrator credential, because it runs before any organization exists.
The AI Gateway’s own inference endpoints (/v1/chat/completions and friends) authenticate with a virtual key rather than an API key, and live on the gateway host.
Conventions
- Request and response fields are
lower_snake_case.
- Money is an integer number of nano-USD (billionths of a dollar), with a decimal string rendered from it for display. The integer is the source of truth: sum integers, round once.
- Timestamps are ISO 8601, except spend and event filters, which take epoch milliseconds.
- List endpoints are cursor-paged: follow
next_cursor until it comes back null. A full page does not mean there is more, and a short page does not mean there is not.
- Errors carry a stable
error.code to branch on. See Errors.
Last modified on August 10, 2026