Skip to content

Gateway endpoints

List provider credentials

Newest first. Never includes a key.

Parameter In Type Required Notes
org_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: array of CredentialOut
422 Validation Error application/json: HTTPValidationError

Add a provider credential

Seal and store the key. base_url is required for openai_compatible, refused otherwise.

409 NOT_CONFIGURED without CREDENTIALS_KEYS; 422 on base_url for a URL that is not https://, has userinfo, a query or a fragment, or resolves to a private address.

Parameter In Type Required Notes
org_id path string (uuid) yes

Request body (application/json, required): CredentialCreate

Status Description Body
201 Successful Response application/json: CredentialOut
422 Validation Error application/json: HTTPValidationError

DELETE /api/v1/orgs/{org_id}/credentials/{credential_id}

Section titled “DELETE /api/v1/orgs/{org_id}/credentials/{credential_id}”

Delete a provider credential

409 CREDENTIAL_IN_USE while a gateway route sends calls through it.

Parameter In Type Required Notes
org_id path string (uuid) yes
credential_id path string (uuid) yes
Status Description Body
204 Successful Response none
422 Validation Error application/json: HTTPValidationError

POST /api/v1/orgs/{org_id}/credentials/{credential_id}/check

Section titled “POST /api/v1/orgs/{org_id}/credentials/{credential_id}/check”

Check a credential

List the provider’s models with the key and record the outcome as the last check.

A failing key is a 200 with status: "error" and a short reason such as 401 Unauthorized.

Parameter In Type Required Notes
org_id path string (uuid) yes
credential_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: CredentialCheckOut
422 Validation Error application/json: HTTPValidationError

POST /api/v1/orgs/{org_id}/credentials/{credential_id}/rotate

Section titled “POST /api/v1/orgs/{org_id}/credentials/{credential_id}/rotate”

Replace a credential’s key

Seal a new key in place of the old one. Clears the last check, which was of the old key.

Parameter In Type Required Notes
org_id path string (uuid) yes
credential_id path string (uuid) yes

Request body (application/json, required): CredentialRotateIn

Status Description Body
200 Successful Response application/json: CredentialOut
422 Validation Error application/json: HTTPValidationError

POST /api/v1/projects/{project_id}/gateway/cache/purge

Section titled “POST /api/v1/projects/{project_id}/gateway/cache/purge”

Purge the gateway response cache

Delete every cached response of the project, whatever key stored it.

Idempotent: purging an empty cache succeeds. The audit event records how many entries went.

Parameter In Type Required Notes
project_id path string (uuid) yes
Status Description Body
204 Successful Response none
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/gateway/fault-profiles

Section titled “GET /api/v1/projects/{project_id}/gateway/fault-profiles”

List fault profiles

By name. active says whether a profile can fire now: enabled and not expired.

Parameter In Type Required Notes
project_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: array of FaultProfileOut
422 Validation Error application/json: HTTPValidationError

POST /api/v1/projects/{project_id}/gateway/fault-profiles

Section titled “POST /api/v1/projects/{project_id}/gateway/fault-profiles”

Create a fault profile

Omitted params are the scenario’s defaults; a param that does not belong to the scenario is 422 on params.<name>. 409 FAULT_PROFILE_NAME_TAKEN for a name already used in the project, and 422 on expires_at for a time that is not in the future.

Parameter In Type Required Notes
project_id path string (uuid) yes

Request body (application/json, required): FaultProfileCreate

Status Description Body
201 Successful Response application/json: FaultProfileOut
422 Validation Error application/json: HTTPValidationError

DELETE /api/v1/projects/{project_id}/gateway/fault-profiles/{profile_id}

Section titled “DELETE /api/v1/projects/{project_id}/gateway/fault-profiles/{profile_id}”

Delete a fault profile

Delete the profile. Keys that ran it are detached and run no fault.

Parameter In Type Required Notes
project_id path string (uuid) yes
profile_id path string (uuid) yes
Status Description Body
204 Successful Response none
422 Validation Error application/json: HTTPValidationError

PATCH /api/v1/projects/{project_id}/gateway/fault-profiles/{profile_id}

Section titled “PATCH /api/v1/projects/{project_id}/gateway/fault-profiles/{profile_id}”

Edit a fault profile

Change the fields sent; send null for expires_at to remove the expiry.

params must be sent with scenario; a scenario sent alone resets the params to that scenario’s defaults.

Parameter In Type Required Notes
project_id path string (uuid) yes
profile_id path string (uuid) yes

Request body (application/json, required): FaultProfileUpdate

Status Description Body
200 Successful Response application/json: FaultProfileOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/gateway/keys

Section titled “GET /api/v1/projects/{project_id}/gateway/keys”

List gateway keys

Newest first, revoked keys included. Unpaginated: a project keeps a handful of keys.

Parameter In Type Required Notes
project_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: array of GatewayKeyOut
422 Validation Error application/json: HTTPValidationError

POST /api/v1/projects/{project_id}/gateway/keys

Section titled “POST /api/v1/projects/{project_id}/gateway/keys”

Create a gateway key

Create the key and return it with its secret, which is never shown again.

Without route_id the key uses the project’s default route: 422 NO_DEFAULT_ROUTE when the project has none, and 422 on route_id for a route that is not the project’s.

Parameter In Type Required Notes
project_id path string (uuid) yes

Request body (application/json, required): GatewayKeyCreate

Status Description Body
201 Successful Response application/json: GatewayKeyCreatedOut
422 Validation Error application/json: HTTPValidationError

DELETE /api/v1/projects/{project_id}/gateway/keys/{key_id}

Section titled “DELETE /api/v1/projects/{project_id}/gateway/keys/{key_id}”

Revoke a gateway key

Revoke the key. Apps using it get 401 from the next call. Revoking twice is a no-op.

Parameter In Type Required Notes
project_id path string (uuid) yes
key_id path string (uuid) yes
Status Description Body
204 Successful Response none
422 Validation Error application/json: HTTPValidationError

PATCH /api/v1/projects/{project_id}/gateway/keys/{key_id}

Section titled “PATCH /api/v1/projects/{project_id}/gateway/keys/{key_id}”

Edit a gateway key

Change the fields sent; send null to clear a limit or the cache TTL.

404 for a revoked key: it can no longer be edited.

Parameter In Type Required Notes
project_id path string (uuid) yes
key_id path string (uuid) yes

Request body (application/json, required): GatewayKeyUpdate

Status Description Body
200 Successful Response application/json: GatewayKeyOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/gateway/overview

Section titled “GET /api/v1/projects/{project_id}/gateway/overview”

Gateway traffic overview

Requests, errors, cache, fallbacks, latency and usage per target and key.

Counts every call that came through a gateway key, Lab faults included (faults says how many). At most 7 days; longer is 422.

Parameter In Type Required Notes
project_id path string (uuid) yes
environment query string or null no max length 64
from query string (date-time) or null no
to query string (date-time) or null no
Status Description Body
200 Successful Response application/json: GatewayOverviewOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/gateway/routes

Section titled “GET /api/v1/projects/{project_id}/gateway/routes”

List gateway routes

By name. Unpaginated: a project keeps a handful of routes.

Parameter In Type Required Notes
project_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: array of RouteOut
422 Validation Error application/json: HTTPValidationError

POST /api/v1/projects/{project_id}/gateway/routes

Section titled “POST /api/v1/projects/{project_id}/gateway/routes”

Create a route

Save the route as version 1. The project’s first route becomes its default.

422 on config.targets.<i>.credential_id for a credential that is not the organization’s; 409 ROUTE_NAME_TAKEN for a name already used in the project.

Parameter In Type Required Notes
project_id path string (uuid) yes

Request body (application/json, required): RouteCreateIn

Status Description Body
201 Successful Response application/json: RouteOut
422 Validation Error application/json: HTTPValidationError

DELETE /api/v1/projects/{project_id}/gateway/routes/{route_id}

Section titled “DELETE /api/v1/projects/{project_id}/gateway/routes/{route_id}”

Delete a route

Delete the route and its history. 409 ROUTE_IN_USE while a gateway key uses it.

Parameter In Type Required Notes
project_id path string (uuid) yes
route_id path string (uuid) yes
Status Description Body
204 Successful Response none
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/gateway/routes/{route_id}

Section titled “GET /api/v1/projects/{project_id}/gateway/routes/{route_id}”

Get a route

Parameter In Type Required Notes
project_id path string (uuid) yes
route_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: RouteOut
422 Validation Error application/json: HTTPValidationError

PUT /api/v1/projects/{project_id}/gateway/routes/{route_id}

Section titled “PUT /api/v1/projects/{project_id}/gateway/routes/{route_id}”

Save a new version of a route

Replace the config, if the route is still at expected_version; bumps version.

409 ROUTE_VERSION_CONFLICT when another save came first: reload and apply the change again.

Parameter In Type Required Notes
project_id path string (uuid) yes
route_id path string (uuid) yes

Request body (application/json, required): RouteUpdateIn

Status Description Body
200 Successful Response application/json: RouteOut
422 Validation Error application/json: HTTPValidationError

POST /api/v1/projects/{project_id}/gateway/routes/{route_id}/default

Section titled “POST /api/v1/projects/{project_id}/gateway/routes/{route_id}/default”

Make a route the default

Gateway keys created without a route use the default one. Not a new version.

Parameter In Type Required Notes
project_id path string (uuid) yes
route_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: RouteOut
422 Validation Error application/json: HTTPValidationError

POST /api/v1/projects/{project_id}/gateway/routes/{route_id}/revert

Section titled “POST /api/v1/projects/{project_id}/gateway/routes/{route_id}/revert”

Revert a route

Save the config of version again as a new version; the history is never rewritten.

404 for a version the route never had; 422 when that config names a credential deleted since.

Parameter In Type Required Notes
project_id path string (uuid) yes
route_id path string (uuid) yes

Request body (application/json, required): RouteRevertIn

Status Description Body
200 Successful Response application/json: RouteOut
422 Validation Error application/json: HTTPValidationError

GET /api/v1/projects/{project_id}/gateway/routes/{route_id}/versions

Section titled “GET /api/v1/projects/{project_id}/gateway/routes/{route_id}/versions”

List a route’s versions

Every saved config, newest first. 404 for an unknown route.

Parameter In Type Required Notes
project_id path string (uuid) yes
route_id path string (uuid) yes
Status Description Body
200 Successful Response application/json: array of RouteVersionOut
422 Validation Error application/json: HTTPValidationError

Chat Completions

OpenAI Chat Completions through the key’s route; streams when stream is true.

Request body (application/json, required): object

Status Description Body
200 Successful Response application/json: any

Messages

Anthropic Messages through the key’s route; streams when stream is true.

Request body (application/json, required): object

Status Description Body
200 Successful Response application/json: any

Models

The models the key can ask for, in the OpenAI shape or, with anthropic-version, the Anthropic one. Records no span and counts no tokens.

Status Description Body
200 Successful Response application/json: any

Responses

OpenAI Responses through the key’s route; streams when stream is true.

Request body (application/json, required): object

Status Description Body
200 Successful Response application/json: any