# API reference

D0/D1 contract. Model operations are explicit capability-gated passthroughs to
compatible upstream paths. The gateway replaces the public model alias and preserves
supported payload fields. Cross-protocol decisions use an explicit, bounded
text/structured-data adapter under decision_translation; other native protocols
retain their own semantics. Every inference capability has an operational flag.
X-Request-Id is the correlation_id; traceparent follows W3C Trace Context.
Data-plane bearer keys require route:models, route:&lt;capability&gt;, or route:* for
the corresponding endpoint. MCP discovery requires mcp:read.
Optional jwt_inference accepts the bounded at+jwt access-token profile with
exact issuer/audience and an explicit subject binding to a managed identity;
console ID tokens and logout assertions are never inference credentials.
With budget_limits or tpm_limits enabled, requests in validated native quota
profiles reserve shared tokens or approved physical-unit budgets before sending.
Missing coverage is denied; unknown outcomes retain
reservations. Admission estimates do not guarantee external provider invoices.
With rate_limits enabled, inference attempts matching a key/team RPM policy
may return 429 and Retry-After. Limits use exact fixed UTC-minute windows.
With team_policy_enforcement enabled, every team-bound key is limited to the
effective team model and route policy. A team without a policy has no access.
Public inference uses /v1; the Gemini-native compatibility surface uses
/v1beta. The canonical control API uses /api/v1/admin. Legacy /api/admin
aliases remain available temporarily for existing clients.

Version `0.76.0` of the contract. Download it whole as [OpenAPI 3.1 YAML](/docs/openapi.yaml), or read it here by area. A running gateway also serves it at `/openapi.yaml` and as an interactive Swagger UI at `/docs/swagger/`.

## Authentication

| Scheme | Kind | Description |
|---|---|---|
| `bearerAuth` | http, bearer | A gateway key, sent as Authorization: Bearer. |
| `adminSession` | apiKey, cookie gateway_admin | Console session cookie from adminLogin or federated sign-in; writes also need the X-CSRF-Token header. With admin.token_bearer true (default false), every operation that accepts it also accepts the shared admin token (or, with admin_viewer, the viewer token) as Authorization Bearer when no cookie is sent: that call has the token's role, needs no CSRF token and works whatever admin.token_login says. A Bearer token shorter than 32 characters is refused; 10 failed Bearer attempts from one client address within a minute answer 429 with Retry-After until the minute ends. Named-user tokens are not accepted as Bearer. |
| `customerViewToken` | http, bearer | Self-service customer view token (gwcv_ prefix) minted by mintCustomerViewToken; read-only, one organization or member, expires by the database clock |
| `customerCredential` | http, bearer | Scoped customer credential (gwcp_ prefix, flag customer_portal_credentials) issued by createCustomerCredential. Accepted only on the customer portal record, usage and approval routes of its own operator team; no CSRF token; checked live on every call, so revocation and expiry apply to the next call. Failed attempts share the admin Bearer limit of 10 per client address per minute. |
| `scimBearer` | http, bearer | Provisioning token whose SHA-256 is in admin.scim_token_sha256_env; distinct from admin and viewer tokens |

## Areas

| Area | Operations | Description |
|---|---|---|
| [Models](/docs/api/models/) | 4 |  |
| [Text generation](/docs/api/text-generation/) | 21 |  |
| [Embeddings and rerank](/docs/api/embeddings-and-rerank/) | 3 |  |
| [Evals](/docs/api/evals/) | 169 |  |
| [Files and batches](/docs/api/files-and-batches/) | 17 |  |
| [Fine-tuning](/docs/api/fine-tuning/) | 10 | OpenAI-compatible fine-tuning jobs (ADR 0121). Jobs run at the provider of the alias first target; ownership, file copies and every read are scoped to the key team by the gateway. |
| [Containers](/docs/api/containers/) | 11 | OpenAI Containers API, the sandboxes of the Responses code interpreter (ADR 0123). Containers run at an OpenAI provider; the gateway keeps an ownership row per container, so routes, lists and Responses tools only reach the caller's own. |
| [Media](/docs/api/media/) | 10 |  |
| [Gemini compatible](/docs/api/gemini-compatible/) | 10 |  |
| [Native passthrough](/docs/api/native-passthrough/) | 12 | Provider-native routes forwarded unchanged under an alias (T133), for features the gateway does not translate. Each alias opts in per provider and keeps the gateway's key, quota and audit checks. |
| [MCP](/docs/api/mcp/) | 16 |  |
| [Vector stores](/docs/api/vector-stores/) | 22 |  |
| [Realtime](/docs/api/realtime/) | 2 | OpenAI Realtime over WebSocket (ADR 0104). |
| [Agents](/docs/api/agents/) | 9 | A2A agent gateway (ADR 0103). Agents are declared in YAML; clients call them here with a gateway key holding agents:invoke, from a team the agent allows. |
| [Access groups](/docs/api/access-groups/) | 3 |  |
| [Alert deliveries](/docs/api/alert-deliveries/) | 2 |  |
| [Alert rules](/docs/api/alert-rules/) | 9 | Alert rules and the alerts they raise (T202, features.alert_rules). alert_rules:read lists alerts and rules, alert_rules:manage changes them; both cover the session's own teams and organization, and every team, every organization and the global rules only with alert_rules:global (admin, and read-only viewer and operator). |
| [Alerts](/docs/api/alerts/) | 4 |  |
| [Monitors](/docs/api/monitors/) | 9 | Evaluation monitors (T186.010, features.evaluation_monitors). monitors:read lists a session's teams' monitors and monitors:manage changes those of the teams it administers; monitors:global (admin, and read-only viewer) widens either to every team. A team whose plan lacks evaluation_monitors has none. |
| [Analytics](/docs/api/analytics/) | 42 |  |
| [Audit](/docs/api/audit/) | 2 |  |
| [Branding](/docs/api/branding/) | 4 |  |
| [Local inference](/docs/api/local-inference/) | 4 |  |
| [Cache](/docs/api/cache/) | 4 |  |
| [Content capture](/docs/api/content-capture/) | 11 | Opt-in encrypted capture of request and response bodies for audit (T113). Policies and grants need content_capture:manage; reading needs an explicit per-user content:read grant, and every read is audited. |
| [Console MFA](/docs/api/console-mfa/) | 19 | Native console second factor (T086.002) - TOTP, passkeys and one-time recovery codes after the first factor. Pending-flow calls send X-MFA-Challenge; session calls send X-CSRF-Token. |
| [Console session](/docs/api/console-session/) | 27 |  |
| [Console users](/docs/api/console-users/) | 24 |  |
| [Durable usage](/docs/api/durable-usage/) | 1 |  |
| [Entitlements](/docs/api/entitlements/) | 7 |  |
| [Extensions](/docs/api/extensions/) | 12 |  |
| [Guardrails](/docs/api/guardrails/) | 13 |  |
| [Infrastructure](/docs/api/infrastructure/) | 34 |  |
| [Invitations](/docs/api/invitations/) | 8 |  |
| [Jwt bindings](/docs/api/jwt-bindings/) | 3 |  |
| [Keys](/docs/api/keys/) | 29 |  |
| [MCP administration](/docs/api/mcp-administration/) | 43 |  |
| [Models and catalog](/docs/api/models-and-catalog/) | 45 |  |
| [Organizations](/docs/api/organizations/) | 8 |  |
| [Pricing](/docs/api/pricing/) | 1 |  |
| [Prompts](/docs/api/prompts/) | 25 |  |
| [Providers](/docs/api/providers/) | 7 |  |
| [Quotas](/docs/api/quotas/) | 35 |  |
| [Rate limits](/docs/api/rate-limits/) | 3 |  |
| [Recycle bin](/docs/api/recycle-bin/) | 2 |  |
| [Request logs](/docs/api/request-logs/) | 45 |  |
| [Traces](/docs/api/traces/) | 20 |  |
| [Requests](/docs/api/requests/) | 1 |  |
| [Resilience](/docs/api/resilience/) | 1 |  |
| [Retention](/docs/api/retention/) | 16 |  |
| [Routing status](/docs/api/routing-status/) | 3 |  |
| [SCIM](/docs/api/scim/) | 14 |  |
| [Skills](/docs/api/skills/) | 16 |  |
| [System](/docs/api/system/) | 10 |  |
| [Teams](/docs/api/teams/) | 14 |  |
| [Attribution groups](/docs/api/attribution-groups/) | 5 |  |
| [Customer portal](/docs/api/customer-portal/) | 24 |  |
| [Usage tags](/docs/api/usage-tags/) | 3 |  |
| [Valuation](/docs/api/valuation/) | 5 |  |
| [Workloads](/docs/api/workloads/) | 6 |  |

Every request and response object is described under [Schemas](/docs/api/schemas/), by initial.
