Skip to main content
The LLM Gateway API is the configuration surface behind the LLM Management hub in the Barndoor portal — exposed so platform teams can script provisioning, manage configuration as code, and run automated audits.
This API configures how the gateway routes and governs traffic. It is separate from the runtime endpoints that carry LLM traffic (/v1/chat/completions, /v1/messages, /v1/embeddings, …), which follow OpenAI’s and Anthropic’s own API shapes and are documented in the Quickstart Guide.

Base URL

All configuration endpoints sit under /api/llm-gateway/admin on your Barndoor portal host:
On a dedicated or self-hosted deployment, replace app.barndoor.ai with your organization’s portal hostname. For comparison, the runtime endpoints live under https://app.barndoor.ai/api/llm-gateway/v1.

Authentication

Configuration endpoints require a Barndoor user bearer token (JWT) — the same identity you use to sign in to the portal. The easiest way to obtain one from a script is the Barndoor SDK:
Send the token on every request:
The bd-… gateway API keys you create through this API authenticate runtime traffic only (/v1/chat/completions, /v1/messages, and so on). They are not accepted on /admin/... endpoints. Use a bearer token for configuration and a bd-… key for traffic.

Permissions

Every configuration endpoint requires the admin (or superadmin) role on the calling user. Users without it receive 403. Developers manage their own keys and see their available models in the portal, under Settings → My Models.

Conventions

  • Every resource is scoped to the caller’s organization. There is no org_id parameter — it’s resolved from your token. A resource in another organization behaves as if it doesn’t exist (404).
  • Timestamps are RFC 3339 (2026-06-12T18:30:00Z).
  • Most resources are identified by UUID. Launch profiles are identified by their slug, and route group members by route name.
  • Most update endpoints accept partial bodies — fields you omit are left unchanged. A handful also distinguish omitted from explicit null (which clears the value); the affected fields are documented inline.

Errors

Errors come back with an HTTP status that matches the failure and a JSON body in OpenAI’s error shape:

API groups

The endpoints are grouped by the resource they manage. Each group maps to a section of LLM Management. Browse each group’s operations in the sidebar.
Routing policies, routing rules, and launch profiles may not be enabled for your organization yet — contact Barndoor if you need them.

Where to next