---
title: "REST API"
description: "Every route the control plane serves, grouped by resource, with the minimum role each needs, plus auth, errors, conditional writes and the event stream."
url: "https://opod.io/docs/control-plane-reference/api/"
markdown_url: "https://opod.io/docs/control-plane-reference/api.md"
section: "Reference"
last_updated: "2026-11-01"
---

# REST API

> Every route the control plane serves, grouped by resource, with the minimum role each needs, plus auth, errors, conditional writes and the event stream.

The control plane serves its API on port 8080 under `/api/v1`, beside the console (`/`), the event stream (`/events`), `/metrics`, `/healthz` and `/readyz`. The API is JSON and changes only by adding.

> **Version**
>
> This page describes `0.3.6`, whose routes are the same as `0.3.0`'s. These routes arrive in `0.3.0` (45 operations): `/api/v1/runs` and every `/api/v1/runs/{id}/…` action (they replace `0.2.1`'s `/api/v1/rollouts`), `/api/v1/connectors` and every `/api/v1/connectors/…` route, `/api/v1/setup`, `/api/v1/api-tokens`, `/api/v1/activity`, `/api/v1/endpoints/{id}/revisions`, `/api/v1/endpoints/{id}/kv`, `…/kv/advice` and `…/kv/tier-advice`, `/api/v1/door/auto-routes` and its keys, `/api/v1/evidence/*`, `/api/v1/usage/gpu-daily`, `/api/v1/fleet/overview`, `PUT /api/v1/licence/fleet`, `/api/v1/remnants`, `/api/v1/nodes/{name}/sharing`, `/api/v1/nodes/{name}/gpus/{index}/reset`, the model approval routes (`…/versions/{v}/approve`, `/api/v1/settings/model-approval`) and `/api/v1/openapi.json`. Outside `/api/v1`, `POST /otlp/v1/logs` (a leader's usage push) arrives in the same release, and so do the push fields of `GET /api/v1/usage/streams` and `GET /api/v1/topology/flow`.

**The machine-readable copy** is an OpenAPI 3.1 document generated from the route table: `GET /api/v1/openapi.json` (viewer), or `opodcp openapi` offline. Every operation carries its minimum role (`x-opod-role`), its tenancy scope (`x-opod-scope`) and a unique command name (`x-cli-name`), so a generic CLI such as Restish can drive every route.

## In short

Everything the console does, it does through this API, so a script can do it too. Send a bearer token, send and receive JSON, and read the role column to know who may call a route. A refusal always has the same body, with an `E-…` code you can script on.

## How to read this page

- **Conventions** first: auth, the error body, conditional writes, rate limits. They hold for every route.
- Then one table per resource. Each row is a method and a path, the **minimum role** (`public`, `viewer`, `operator`, `admin`), and what it does, with its query parameters. A path written `…/x` continues the full path given first in the same row.
- The `curl` lines under a table are runnable examples; they use `$CP` and `$H` from [Conventions](#conventions).
- A route that is new in 0.3.0 is listed in the Version note above.
- For every field of a request or answer, read `GET /api/v1/openapi.json`, or the guide page each section links to.

## A worked example, end to end

Create an endpoint, wait for it, mint a key and call the model through the control plane:

```bash
CP=https://cp.example.com
H="Authorization: Bearer $OPODCP_TOKEN"

# 1. create (operator) → 201 with the record
ID=$(curl -s -H "$H" -H 'Content-Type: application/json' -X POST "$CP/api/v1/endpoints" \
  -d '{"name":"chat","model":"qwen2.5-7b-instruct","plan":{"model":{"id":"qwen2.5-7b-instruct","engine":"vllm"},"workers":[{"replicas":1}]}}' \
  | jq -r .id)

# 2. wait until the phase is "serving"
until [ "$(curl -s -H "$H" "$CP/api/v1/endpoints/$ID/status" | jq -r .phase)" = serving ]; do sleep 10; done

# 3. mint a key (operator) → 201; the plaintext "key" is in this answer only
KEY=$(curl -s -H "$H" -H 'Content-Type: application/json' -X POST "$CP/api/v1/endpoints/$ID/keys" \
  -d '{"name":"smoke"}' | jq -r .key)

# 4. call the model through the control plane's proxy, as a client with that key would
curl -s -H "$H" -H "X-Opod-Endpoint-Key: $KEY" -H 'Content-Type: application/json' \
  -X POST "$CP/api/v1/endpoints/$ID/gateway/v1/chat/completions" \
  -d '{"model":"qwen2.5-7b-instruct","messages":[{"role":"user","content":"hello"}]}' | jq -r '.choices[0].message.content'

# 5. the usage the call left, totals and per endpoint
curl -s -H "$H" "$CP/api/v1/usage/summary?endpoint=$ID" | jq .
```

A step that fails answers the common error body: for example `409 conflict` when `chat` exists, or `400` with `details.code: "E-FIT"` when it does not fit.

## Conventions

**Auth.** `Authorization: Bearer <token>` on every `/api/v1` route except the public ones marked below. See [Users, roles and SSO](https://opod.io/docs/control-plane-security/authentication/). Roles: `viewer` < `operator` < `admin`. A `machine token` with a write scope reaches only the routes its scope names.

**Errors.** One body: `{ "error": "<message>", "code": "invalid|not_found|conflict|unauthorized|forbidden|rate_limited|internal", "details": { … } }`. A planner refusal is a `400` with `details.code` (an `E-…` code) and `details.alternatives`. See [Error codes](https://opod.io/docs/control-plane-reference/error-codes/). `403` covers both a role too low and another team's object; the message never names that team. An unknown `/api/` path is a JSON `404`.

**Conditional writes.** `PUT /api/v1/endpoints/{id}/policy` and `PUT /api/v1/alert-rules` replace a whole document. Their `GET`s carry `revision` and a strong `ETag`; send it back as `If-Match` and the write applies only while the document is unchanged, else `409` with nothing written.

**Rate limits.** With `api.rateLimit.rps` above 0, each caller (a user, the admin token, an OIDC subject, a machine token) has its own token bucket of `rps` and `burst`. Over it the answer is `429 rate_limited` with `Retry-After`; no other caller is affected. It is off by default. `POST /api/v1/login` always has its own bucket per client address: ten attempts at once, then one every six seconds. The address is the TCP peer, or the right-most `X-Forwarded-For` hop that is not a proxy listed in `api.trustedProxies`; an IPv6 client is counted by its /64. Every refused sign-in publishes `auth.login_failed`.

**Body limits.** Most write routes read at most 64 KiB of JSON; a larger body is `400 invalid`.

**A request, end to end.** Every example below uses these two variables:

```bash
CP=https://cp.example.com
H="Authorization: Bearer $OPODCP_TOKEN"
curl -s -H "$H" "$CP/api/v1/me"
# {"name":"alice","role":"operator","team":"search"}
curl -s -H "$H" "$CP/api/v1/endpoints/does-not-exist"
# {"error":"…","code":"not_found"}   with status 404
```

**Downloads and the stream.** `GET /events`, `GET /api/v1/audit/export`, `GET /api/v1/audit/chain` and `GET /api/v1/usage/export` also accept `?ticket=`: a single-use ticket from `POST /api/v1/stream-ticket`, good for 30 s and carrying the caller's own role. No other route accepts a credential in the URL.

**Setup mode.** With no usable database, every `/api/` call but `GET /api/v1/setup`, `GET /api/v1/doctor` and `POST /api/v1/connectors/state/verify` answers `503 E-SETUP`. A database lost while running answers `503 E-DB-UNREACHABLE`.

## Public and meta

| Method and path                                                 | Role   | Purpose                                                                                                                     |
| --------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| `GET /healthz`                                                  | public | liveness                                                                                                                    |
| `GET /readyz`                                                   | public | readiness; stays Ready with no database so the pod can report it                                                            |
| `GET /metrics`                                                  | public | Prometheus metrics                                                                                                          |
| `GET /api/v1/setup`                                             | public | `ready` or setup mode, its kind and sentence                                                                                |
| `POST /api/v1/login`                                            | public | local sign-in `{name, password}` → `{token, name, role, team, expiresAt}`                                                   |
| `GET /api/v1/auth/methods`                                      | public | which sign-in methods are on                                                                                                |
| `GET /api/v1/auth/oidc/start`, `GET /api/v1/auth/oidc/callback` | public | the OIDC flow; your identity provider calls the callback with `?code=&state=`, or `?error=&error_description=` on a refusal |
| `POST /api/v1/logout`                                           | viewer | end the session                                                                                                             |
| `GET /api/v1/me`                                                | viewer | the caller: `{name, role, team}`                                                                                            |
| `POST /api/v1/stream-ticket`                                    | viewer | a single-use 30 s ticket for `/events` and the three downloads (see Conventions)                                            |
| `GET /api/v1/version`                                           | viewer | version, commit, supported leader versions, where this control plane runs, `mode`                                           |
| `GET /api/v1/openapi.json`                                      | viewer | this API as OpenAPI 3.1                                                                                                     |
| `GET /api/v1/capabilities`                                      | viewer | capabilities that are `partial` or `target`                                                                                 |
| `GET /api/v1/doctor`                                            | viewer | the doctor rows                                                                                                             |
| `GET /api/v1/controllers`                                       | viewer | every control loop: interval, runs, errors, last run                                                                        |
| `GET /api/v1/cell`                                              | viewer | the cell: name, provider, Kubernetes version, nodes, GPUs, endpoints, door URL                                              |
| `GET /api/v1/config`                                            | admin  | every `OPODCP_*` variable, redacted, with the `helm upgrade` that changes it                                                |
| `GET /api/v1/metrics/fleet`                                     | viewer | the one-minute fleet sample the Overview plots                                                                              |
| `GET /events`                                                   | viewer | server-sent events (below); `?since=<seq>` (or the `Last-Event-ID` header) replays up to 1,000 missed events first          |

```bash
curl -s "$CP/api/v1/setup"                                   # public: {"state":"ready"}, or setup mode's state, kind and sentence
curl -s -X POST "$CP/api/v1/login" -d '{"name":"admin","password":"…"}'
# {"token":"…","name":"admin","role":"admin","team":"","expiresAt":"2026-10-31T09:00:00Z"}
curl -N -H "$H" "$CP/events?since=4812"                     # replay from event 4812, then follow
```

## Users and machine tokens

| Method and path                                                                       | Role   | Purpose                                      |
| ------------------------------------------------------------------------------------- | ------ | -------------------------------------------- |
| `GET /api/v1/users`, `POST /api/v1/users`, `DELETE /api/v1/users/{id}`                | admin  | local users                                  |
| `GET /api/v1/api-tokens`, `POST /api/v1/api-tokens`, `DELETE /api/v1/api-tokens/{id}` | admin  | machine tokens                               |
| `GET /api/v1/teams`                                                                   | viewer | teams with their counts, GPUs held and quota |
| `GET /api/v1/team-quotas`                                                             | viewer | GPU quotas                                   |
| `PUT /api/v1/team-quotas`                                                             | admin  | replace the quota set                        |

## Endpoints

| Method and path                                                    | Role                    | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GET /api/v1/endpoints`                                            | viewer                  | list; `?expand=plan` attaches each plan                                                                                                                                                                                                                                                                                                                                                                                                                |
| `POST /api/v1/endpoints`                                           | operator                | create (a run)                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `POST /api/v1/endpoints/preview`                                   | operator                | the create's dry run                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `GET /api/v1/endpoints/status`                                     | viewer                  | every visible endpoint's status in one call                                                                                                                                                                                                                                                                                                                                                                                                            |
| `GET /api/v1/endpoints/{id}`                                       | viewer                  | one endpoint, with `url`, `publicUrl`, TLS fingerprint, resilience; `?expand=plan` attaches the plan                                                                                                                                                                                                                                                                                                                                                   |
| `DELETE /api/v1/endpoints/{id}`                                    | operator                | delete (a run; `202`)                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET /api/v1/endpoints/{id}/plan`                                  | viewer                  | the plan                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `PUT /api/v1/endpoints/{id}/plan`                                  | operator, `plans:write` | edit the plan; `?dryRun=true` validates only                                                                                                                                                                                                                                                                                                                                                                                                           |
| `POST /api/v1/endpoints/{id}/rollouts`                             | operator, `plans:write` | start a verified rollout with the posted plan; `?note=`                                                                                                                                                                                                                                                                                                                                                                                                |
| `GET /api/v1/endpoints/{id}/revisions`, `…/revisions/{rev}`        | viewer                  | plan history, newest first; `?before=<rev>&limit=<n>` pages it (both positive integers)                                                                                                                                                                                                                                                                                                                                                                |
| `GET /api/v1/endpoints/{id}/status`                                | viewer                  | observed phase, proof, pods, gangs, scaling                                                                                                                                                                                                                                                                                                                                                                                                            |
| `GET /api/v1/endpoints/{id}/logs`                                  | viewer                  | a pod's log tail: `?pod=<name>&tail=<lines>&previous=true`; `tail` defaults to 200, at most 5000; `previous=true` reads the last crashed container                                                                                                                                                                                                                                                                                                     |
| `GET /api/v1/endpoints/{id}/load`                                  | viewer                  | the leader's `/loadz`; in the release after 0.3.6 also `slow_workers`                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET /api/v1/endpoints/{id}/registry`                              | viewer                  | the leader's own worker rows                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `GET /api/v1/endpoints/{id}/shards`                                | viewer                  | the leader's gang rows                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `POST /api/v1/endpoints/{id}/shards/reform`                        | operator                | re-form the gangs                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `GET /api/v1/endpoints/{id}/kv`, `…/kv/advice`, `…/kv/tier-advice` | viewer                  | KV cache per worker and measured advice; from 0.3.2 each worker row also carries `engineVersion`, the engine's own version as its worker reports it (`0.33.0` for vLLM, `b11028-972d2313b` for a llama-server build); in the release after 0.3.6 each worker's `load` also carries `kv_xfer_bytes_total`, `kv_xfer_seconds_total`, `kv_xfers_total`, `kv_fetch_waiting_to_start`, `kv_fetch_in_progress`, `kv_fetch_loaded` (absent when not reported) |
| `PUT /api/v1/endpoints/{id}/slo`                                   | operator                | state or clear the SLO; rolls nothing                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET /api/v1/endpoints/{id}/autoscale/stats`                       | viewer                  | what parking saved, the last wake; `?since=<RFC 3339>`                                                                                                                                                                                                                                                                                                                                                                                                 |
| `POST /api/v1/endpoints/{id}/adapters`, `DELETE …/adapters/{name}` | operator                | add or remove a LoRA adapter live                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `PUT /api/v1/endpoints/{id}/remote-key`                            | operator                | rotate a remote endpoint's vendor key                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET`, `POST /api/v1/endpoints/{id}/gateway/{path}`                | viewer, operator        | proxy to the endpoint's leader (`X-Opod-Endpoint-Key` picks the credential)                                                                                                                                                                                                                                                                                                                                                                            |
| `POST /api/v1/apply`                                               | operator                | create or update from a scenario document                                                                                                                                                                                                                                                                                                                                                                                                              |

```bash
curl -s -H "$H" "$CP/api/v1/endpoints?expand=plan" | jq '.[] | {name, engine, revision: .plan.revision}'
curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/revisions?limit=5"
curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/revisions?before=12&limit=5"   # the page before revision 12
curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/logs?pod=opodcp-ep-chat-w0-6d9f&tail=500&previous=true"
curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/autoscale/stats?since=2026-10-29T00:00:00Z"
curl -s -H "$H" -X PUT "$CP/api/v1/endpoints/ep_7f3a/plan?dryRun=true" -d @plan.json   # validate only
curl -s -H "$H" -X POST "$CP/api/v1/endpoints/ep_7f3a/rollouts?note=vllm%200.11" -d @plan.json
```

## Keys, auth and policy

| Method and path                                               | Role                     | Purpose                                |
| ------------------------------------------------------------- | ------------------------ | -------------------------------------- |
| `GET /api/v1/keys`                                            | viewer                   | every key the caller may see           |
| `GET /api/v1/endpoints/{id}/keys`                             | viewer                   | one endpoint's keys                    |
| `POST /api/v1/endpoints/{id}/keys`                            | operator, `tokens:write` | mint a key (plaintext once)            |
| `DELETE /api/v1/endpoints/{id}/keys/{kid}`                    | operator, `tokens:write` | revoke                                 |
| `GET`, `PUT /api/v1/endpoints/{id}/auth`                      | viewer, operator         | `requireKeys` and the snapshot's state |
| `GET /api/v1/endpoints/{id}/worker-identities`                | viewer                   | worker certificates                    |
| `POST /api/v1/endpoints/{id}/worker-identities/{node}/revoke` | operator                 | revoke a worker's certificate          |
| `GET /api/v1/policies`                                        | viewer                   | every endpoint's policy                |
| `GET`, `PUT /api/v1/endpoints/{id}/policy`                    | viewer, operator         | one endpoint's policy (`If-Match`)     |
| `GET`, `PUT /api/v1/door/auto-routes`                         | viewer, admin            | the cell door's auto routes            |
| `GET`, `POST /api/v1/door/auto-routes/{name}/keys`            | viewer, admin            | route keys                             |
| `DELETE /api/v1/door/auto-routes/{name}/keys/{kid}`           | operator                 | revoke a route key                     |

```bash
curl -s -H "$H" -X POST "$CP/api/v1/endpoints/ep_7f3a/keys" -d '{"name":"ci-bot","expiresAt":"2027-01-31T00:00:00Z"}'
curl -s -H "$H" "$CP/api/v1/endpoints/ep_7f3a/policy" -D - | grep -i etag          # ETag: "3f9a0c2b71de"
curl -s -H "$H" -H 'If-Match: "3f9a0c2b71de"' -X PUT "$CP/api/v1/endpoints/ep_7f3a/policy" -d @policy.json
```

## Runs

| Method and path                                       | Role     | Purpose                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GET /api/v1/runs`                                    | viewer   | list; `?kind=a,b&endpoint=<id>&limit=`                                                                                                                                                                                                                                                                                                                                         |
| `GET /api/v1/runs/{id}`                               | viewer   | one run with its steps                                                                                                                                                                                                                                                                                                                                                         |
| `GET /api/v1/runs/{id}/log`                           | viewer   | each step's lines; `?step=&after=&format=text`                                                                                                                                                                                                                                                                                                                                 |
| `POST /api/v1/runs/{id}/cancel`                       | operator | stop and give back; `?force=true`                                                                                                                                                                                                                                                                                                                                              |
| `POST /api/v1/runs/{id}/rollback`                     | operator | roll back to the plan the run captured                                                                                                                                                                                                                                                                                                                                         |
| `POST /api/v1/runs/{id}/promote`, `…/abort`           | operator | end an unjudged canary hold                                                                                                                                                                                                                                                                                                                                                    |
| `POST /api/v1/runs/{id}/signature/accept`, `…/reject` | admin    | decide a model signature hold                                                                                                                                                                                                                                                                                                                                                  |
| `GET /api/v1/activity`                                | viewer   | changes and events, classified, newest first, repeats folded. `?endpoint=<id>`, `?filter=` (`changes`, `events`, `warnings`, `create`, `edit`, `rollout`, `scale`, `delete`, `worker`, `health`, `cell`), `?actor=people\|system`, plus the audit filters below (`source`, `type`, `q`, `since`, `until`, `limit`). Pass the answer's `next` back as `until` for the next page |
| `GET /api/v1/events/recent`                           | viewer   | the last 200 lifecycle events; it takes no query parameter                                                                                                                                                                                                                                                                                                                     |

```bash
curl -s -H "$H" "$CP/api/v1/runs?kind=rollout,rollback&endpoint=ep_7f3a&limit=20"
curl -s -H "$H" "$CP/api/v1/runs/run_91c2/log?step=verify&after=120&format=text"
curl -s -H "$H" -X POST "$CP/api/v1/runs/run_91c2/cancel?force=true"
curl -s -H "$H" "$CP/api/v1/activity?endpoint=ep_7f3a&filter=rollout&actor=people&since=7d&limit=50"
curl -s -H "$H" "$CP/api/v1/activity?endpoint=ep_7f3a&until=2026-10-28T14:02:11.204Z"   # the next page: the previous answer's next
```

## Models

| Method and path                                              | Role             | Purpose                                                                                                                                                                                                                                                                           |
| ------------------------------------------------------------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/v1/models`, `GET /api/v1/models/{id}`              | viewer           | the registry                                                                                                                                                                                                                                                                      |
| `POST /api/v1/models`                                        | operator         | add a model                                                                                                                                                                                                                                                                       |
| `DELETE /api/v1/models/{id}`                                 | admin            | remove a model not in use                                                                                                                                                                                                                                                         |
| `GET /api/v1/models/validate`                                | viewer           | probe a Hub repo and file: `?repo=<org/name>&file=<name.gguf>`; `repo` is required                                                                                                                                                                                                |
| `GET`, `POST /api/v1/models/{id}/prefetch`                   | viewer, operator | warm a model onto a node, or read that warm's state; `?node=<name>` (required on `GET`). In the release after 0.3.6 the answer carries `bytesPerSec` and `source` (`hub` or `mirror <url>`) once the fetch ran, and fetch Jobs use the Hub mirror (`HF_ENDPOINT`) like workers do |
| `GET`, `POST /api/v1/models/{id}/versions`                   | viewer, operator | versions                                                                                                                                                                                                                                                                          |
| `POST /api/v1/models/{id}/versions/{v}/promote`, `…/archive` | operator         | move a version's label                                                                                                                                                                                                                                                            |
| `POST`, `DELETE /api/v1/models/{id}/versions/{v}/approve`    | admin            | approve or clear approval                                                                                                                                                                                                                                                         |
| `GET /api/v1/models/{id}/versions/{v}/rollback/preview`      | viewer           | what a version rollback would do                                                                                                                                                                                                                                                  |
| `POST /api/v1/models/{id}/versions/{v}/rollback`             | operator         | roll endpoints back to a version                                                                                                                                                                                                                                                  |
| `GET`, `PUT /api/v1/settings/model-approval`                 | viewer, admin    | `requireApproval`                                                                                                                                                                                                                                                                 |
| `GET`, `PUT /api/v1/settings/hub-token`                      | viewer, admin    | the cluster's Hugging Face token (never returned)                                                                                                                                                                                                                                 |

```bash
curl -s -H "$H" "$CP/api/v1/models/validate?repo=Qwen/Qwen2.5-7B-Instruct-GGUF&file=qwen2.5-7b-instruct-q4_k_m.gguf"
curl -s -H "$H" -X POST "$CP/api/v1/models/qwen2.5-7b/prefetch?node=node-b"
curl -s -H "$H" "$CP/api/v1/models/qwen2.5-7b/prefetch?node=node-b"       # the warm's state
```

## Nodes and capacity

| Method and path                                        | Role       | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/v1/nodes`                                    | viewer     | nodes with cards, holders, taints, host facts. In the release after 0.3.6, each node also carries `addresses` (`[{type, address}]` from the node's status), `podCIDRs`, `podIPCapacity` (usable pod IPs in those ranges), `podIPsUsed` (pods of every namespace holding a pod IP there, not on the host network and not finished; absent when the control plane could not list pods cluster-wide), `rdmaAllocatable`, and per NIC `mtu`, `oper` (`up`, `down`, `unknown`) and the rates `rxBps`, `txBps`, `rxErrPerMin`, `txErrPerMin`, `rxDropPerMin`, `txDropPerMin`, `rateWindowSeconds`. A rate is absent until two probe samples were read, and after a counter reset |
| `GET /api/v1/capacity/ledger`                          | viewer     | the placer's ledger                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `GET /api/v1/capacity/fits`                            | viewer     | how many more of a model fit; `?model=`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `GET /api/v1/topology/flow`                            | viewer     | request flow from captured facts; `?since=<RFC 3339>`. Each usage lane carries `mode` (`push` or `pull`) and `lastSeenAt`, the newest pull, push or push check, so an idle pushing leader does not read as stale                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `POST /api/v1/nodes/{name}/cordon`, `…/uncordon`       | admin      | cordon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `GET /api/v1/nodes/{name}/evacuate/preview`            | admin      | what an evacuate or drain would move                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `POST /api/v1/nodes/{name}/evacuate`                   | admin      | move our workloads                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `POST /api/v1/nodes/{name}/drain`                      | admin      | evacuate, then evict the rest; `{confirm}`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `PATCH /api/v1/nodes/{name}/labels`                    | admin      | change `opod.io/*` labels                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `DELETE /api/v1/nodes/{name}`                          | admin      | remove a dead node                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `POST /api/v1/nodes/{name}/sharing`                    | admin      | time-slice or budget                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `GET /api/v1/nodes/{name}/cache`, `POST …/cache/prune` | admin      | preview and prune the model cache. `?minAge=<duration>` keeps files used more recently (default `24h`, so a rollback finds its weights warm); `POST …/cache/prune?dryRun=true` answers the preview and removes nothing                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `GET`, `POST /api/v1/nodes/{name}/gpus/{index}/reset`  | admin      | preview and reset a card held outside opod                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `GET /api/v1/remnants`                                 | viewer     | objects nothing owns; `?all=true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `POST /api/v1/remnants/{id}/clean`                     | admin      | clean one                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `POST /api/v1/nodes/{name}/report`                     | node token | the telemetry probe's push. In the release after 0.3.6 it answers `200` with `{meshPeers}`, the peers this node's probe measures next. In that release only a control plane outside its cluster is pushed to; one inside reads each probe itself (`POST /v1/report` on the probe pod's port 9147, signed with the node report token), so every replica sees every node                                                                                                                                                                                                                                                                                                     |

```bash
curl -s -H "$H" "$CP/api/v1/capacity/fits?model=qwen2.5-7b"
curl -s -H "$H" "$CP/api/v1/topology/flow?since=2026-10-30T08:00:00Z"
curl -s -H "$H" "$CP/api/v1/nodes/node-b/cache?minAge=72h"                  # what a prune would remove
curl -s -H "$H" -X POST "$CP/api/v1/nodes/node-b/cache/prune?minAge=72h"
curl -s -H "$H" "$CP/api/v1/remnants?all=true"
```

## Compatibility and fabric

| Method and path                       | Role          | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/v1/compat`                  | viewer        | the engine × vendor capability graph; from the release after 0.3.6 also `options[]`: per engine and vendor, whether each gated endpoint-form choice (the `cpu`, `auto`, `disk` and `peer` KV tiers, a prefill/decode role, `kvEvents`) is available, with the planner's `code`, `reason`, `remedy` and the Connectors port that fixes it (`connect`); and, in the release after 0.3.6, rows for every engine (`engine: ""`) for what the install refuses — an InferencePool without its CRD, Gateway or picker; a gang across machines without the LeaderWorkerSet controller; replicas, an autoscaled max above 1 or a gang under `workers.mtls=require`; under KEDA a prefill/decode split or a second worker row with autoscale above its floor, and speculative decoding with a gang — where `with: {field, value}` names the other choice a refusal needs |
| `GET /api/v1/compat/resolve`          | viewer        | judge one shape: `?vendor=&engine=&model=&tensor=&pipeline=&data=`; `&node=<name>` judges it on that node (and takes its vendor); `&crossNode=true` asks for a shape across machines                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `GET /api/v1/compat/verified`         | viewer        | proven paths                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `POST /api/v1/compat/verified`        | operator      | record an integration proof (what `opodcp verify` sends)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `GET /api/v1/compat/verified/history` | viewer        | the release after 0.3.6: every kept proof of one path, oldest first (the newest 50); `?pathKey=` (required). `[]` for a path with none. A withdrawn path loses its history                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `DELETE /api/v1/compat/verified`      | admin         | withdraw a proof; `?pathKey=`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET`, `PUT /api/v1/fabric-policy`    | viewer, admin | the RDMA bandwidth floor and proven domains                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `GET /api/v1/network/mesh`            | viewer        | the release after 0.3.6: TCP connect round trips between the GPU probes over the pod network, once a minute: `pairs[]` with `lossPct`, `rttP50Ms`, `rttP99Ms`, and a DNS lookup per node. A pair not measured is absent. Empty where the probe does not run as the node agent                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `GET /api/v1/network/policies`        | viewer        | the release after 0.3.6: the NetworkPolicies the control plane wrote, with their selectors and ingress rules                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `GET /api/v1/network/explain`         | viewer        | the release after 0.3.6: can a pod reach another on a port, answered from the NetworkPolicies of both namespaces; `allowed` is `true`, `false` or `null` (cannot be decided). Sends no packet. `from` and `to` are `<namespace>/<pod>`, or a namespace plus `fromLabels` / `toLabels` in `kubectl -l` form (`app=x,role=y`; present and empty = any pod); `port` (1–65535, required); `protocol` `TCP` (default), `UDP` or `SCTP`. `400` names what is wrong                                                                                                                                                                                                                                                                                                                                                                                                   |
| `GET /api/v1/images`                  | viewer        | every configured image, its pin and signature                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

```bash
curl -s -H "$H" "$CP/api/v1/compat" | jq '.options[] | select(.engine=="vllm" and .value=="peer" and (.vendor // "")=="")'   # why peer is not selectable
curl -s -H "$H" "$CP/api/v1/compat/resolve?vendor=nvidia&engine=vllm&model=qwen2.5-32b&tensor=2"
curl -s -H "$H" "$CP/api/v1/compat/resolve?node=node-a&engine=vllm&model=qwen2.5-32b&tensor=2&pipeline=2&crossNode=true"
curl -s -H "$H" -X DELETE "$CP/api/v1/compat/verified?pathKey=nvidia/vllm/tp2-pp1-dp1/…"   # a pathKey from GET /api/v1/compat/verified
curl -s -H "$H" "$CP/api/v1/network/mesh"                                     # the release after 0.3.6
curl -s -H "$H" "$CP/api/v1/network/explain?from=team-a&fromLabels=app%3Dclient&to=opodcp/opodcp-ep-chat-leader-0&port=8080"   # the release after 0.3.6
curl -s -H "$H" "$CP/api/v1/compat/verified/history?pathKey=nvidia%2Fvllm%2Ftp1-pp2-dp1%2F…"     # the release after 0.3.6
```

## Jobs and batches

| Method and path                                                    | Role                                 | Purpose                                                                                         |
| ------------------------------------------------------------------ | ------------------------------------ | ----------------------------------------------------------------------------------------------- |
| `GET`, `POST /api/v1/jobs`                                         | viewer, operator                     | list, submit                                                                                    |
| `GET /api/v1/jobs/{id}`, `…/logs`                                  | viewer                               | read, log; `?tail=<lines>` (default 200, at most 5000)                                          |
| `POST /api/v1/jobs/{id}/cancel`                                    | operator                             | cancel                                                                                          |
| `DELETE /api/v1/jobs/{id}`                                         | operator                             | delete a finished job                                                                           |
| `GET /api/v1/batches`                                              | viewer                               | batch records                                                                                   |
| `POST`, `GET /v1/files`; `GET /v1/files/{id}`, `…/content`         | operator, viewer, or an endpoint key | OpenAI files; `GET /v1/files?purpose=batch` filters by purpose                                  |
| `POST`, `GET /v1/batches`; `GET /v1/batches/{id}`; `POST …/cancel` | operator, viewer, or an endpoint key | OpenAI batches; `GET /v1/batches?limit=<n>&after=<id>` pages the list (default 20, at most 100) |

```bash
curl -s -H "$H" "$CP/api/v1/jobs/job_44a1/logs?tail=1000"
curl -s -H "Authorization: Bearer sk-orc-…" "$CP/v1/files?purpose=batch"
curl -s -H "Authorization: Bearer sk-orc-…" "$CP/v1/batches?limit=50&after=batch_0192"
```

## Usage

| Method and path                | Role                       | Purpose                                                                                                                                                                                                                                                                               |
| ------------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/v1/usage/summary`    | viewer                     | totals and per-endpoint, model, team, worker, job; `?since=<RFC 3339>`; `?endpoint=<id>` (repeatable) narrows it. `?until=<RFC 3339>` (exclusive) is checked for its form on 0.2.1 but not applied; 0.3.0 applies it to every aggregate except `rpm60`, which is always the last hour |
| `GET /api/v1/usage/export`     | operator                   | CSV in a window: `?since=&until=` (RFC 3339; `until` not before `since`)                                                                                                                                                                                                              |
| `GET /api/v1/usage/gpu-daily`  | viewer                     | GPU-hours per UTC day, JSON or CSV: `?from=YYYY-MM-DD&to=YYYY-MM-DD&format=csv` (or `Accept: text/csv`)                                                                                                                                                                               |
| `GET /api/v1/usage/streams`    | viewer                     | how each endpoint's usage arrives: `endpoint`, `cursor`, `lastPullAt`, `lastError`, `lastBatch`, `leaderBoot`, `bootResets`; and `mode` (`push` or `pull`), `lastPushAt`, `lastSeenAt`, `pushBoot`, `pushSeq`, `missing` (see below)                                                  |
| `POST /otlp/v1/logs`           | the endpoint's admin token | a leader's usage push, not a user route (see below)                                                                                                                                                                                                                                   |
| `GET /api/v1/usage/retention`  | viewer                     | the window, the sink's lag                                                                                                                                                                                                                                                            |
| `POST /api/v1/usage/sink/skip` | admin                      | accept that the sink never gets rows before `?before=`                                                                                                                                                                                                                                |

```bash
curl -s -H "$H" "$CP/api/v1/usage/summary?since=2026-10-01T00:00:00Z&endpoint=ep_7f3a&endpoint=ep_19bd"
curl -s -H "$H" "$CP/api/v1/usage/export?since=2026-10-01T00:00:00Z&until=2026-11-01T00:00:00Z" > usage-oct.csv
curl -s -H "$H" "$CP/api/v1/usage/gpu-daily?from=2026-10-01&to=2026-10-31&format=csv" > gpu-hours-oct.csv
curl -s -H "$H" -X POST "$CP/api/v1/usage/sink/skip?before=2026-10-15T00:00:00Z"
```

**The usage push.** `POST /otlp/v1/logs` and the push fields are new in 0.3.0. A leader from core v0.4.0 (feature `usage_push`) sends its usage records here as OTLP/HTTP protobuf, and the control plane pulls only a leader without that feature. The control plane renders the URL and the credential into every leader, so you never call this route yourself:

```text
POST /otlp/v1/logs
Content-Type: application/x-protobuf
Authorization: Bearer <the endpoint's admin token>
X-Opod-Endpoint: <endpoint id>
```

| Answer                    | Meaning                                                                                                                                                                 |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200`                     | Stored. A resend of the same (`opod.leader.boot`, `opod.usage.seq`) is one row. `partialSuccess.rejectedLogRecords` counts records with no key, which the leader drops. |
| `400`                     | The body is not an `ExportLogsServiceRequest`. The leader drops the batch.                                                                                              |
| `401`, `404`, `415`       | Wrong token, unknown endpoint, not protobuf. The leader keeps the records and sends them again.                                                                         |
| `413`                     | The body is larger than 4 MiB; a leader sends at most 1 MiB.                                                                                                            |
| `503` + `Retry-After: 10` | The control plane has just started and has not yet read the endpoint's workers. The leader sends again.                                                                 |

In `GET /api/v1/usage/streams`, `mode` is `push` or `pull`. `lastSeenAt` is the newest pull, push or push check: it says the lane works, because an idle pushing leader sends nothing. `pushBoot` and `pushSeq` are the leader boot and sequence last stored. `missing` counts the sequences of one boot that never arrived, which are the records the leader dropped at its queue's cap. The record is kept in the state store, so with `replicas` above 1 every replica answers the same, whichever one took the pushes or runs the pull. A leader restart loses what it held and shows as a new `pushBoot`, not in `missing`. A leader that pushed in the last 2 minutes is not pulled.

## Alerts, audit and evidence

| Method and path                                                    | Role          | Purpose                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/v1/alerts`, `GET /api/v1/alerts/{id}`                    | viewer        | alerts; `?state=open\|resolved\|all`, `?object=endpoints/<id>` (exact), `?since=<RFC 3339>`, `?limit=<n>` (default 200)                                                                                                                                                                             |
| `POST /api/v1/alerts/{id}/ack`                                     | operator      | acknowledge                                                                                                                                                                                                                                                                                         |
| `GET`, `PUT /api/v1/alert-rules`                                   | viewer, admin | your alert rules (`If-Match`)                                                                                                                                                                                                                                                                       |
| `GET /api/v1/audit`                                                | viewer        | the audit record. `?source=leader\|cp`, `?type=<prefix>`, `?q=<text>` (case-insensitive, over type, subject, endpoint, actor and data), `?since=` (RFC 3339 or a duration back from now: `24h`, `7d`), `?until=<RFC 3339>` (inclusive cursor for older rows), `?limit=` (default 200, at most 2000) |
| `GET /api/v1/audit/export`                                         | operator      | CSV, with the same filters as `GET /api/v1/audit`                                                                                                                                                                                                                                                   |
| `GET /api/v1/audit/verify`, `GET /api/v1/audit/chain`              | admin         | walk the chain, export it                                                                                                                                                                                                                                                                           |
| `POST /api/v1/audit/rebase`                                        | admin         | declare the chain verified from its head                                                                                                                                                                                                                                                            |
| `GET`, `PUT /api/v1/audit/retention`; `PUT /api/v1/audit/keep-all` | viewer, admin | audit retention                                                                                                                                                                                                                                                                                     |
| `GET /api/v1/evidence/ml-bom`                                      | admin         | CycloneDX 1.6 ML-BOM of deployed models                                                                                                                                                                                                                                                             |
| `GET /api/v1/evidence/retention`                                   | viewer        | log retention against six months                                                                                                                                                                                                                                                                    |

```bash
curl -s -H "$H" "$CP/api/v1/alerts?state=open&object=endpoints/ep_7f3a&limit=20"
curl -s -H "$H" "$CP/api/v1/audit?source=cp&type=key.&q=ci-bot&since=24h"
curl -s -H "$H" "$CP/api/v1/audit?until=2026-10-29T10:12:00.512Z&limit=200"   # older rows
curl -s -H "$H" "$CP/api/v1/audit/export?type=auth.&since=30d" > auth-30d.csv
```

## Connectors, licence, fleet and store

| Method and path                          | Role                           | Purpose                                                                                                                                                                                       |
| ---------------------------------------- | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /api/v1/connectors`                 | viewer                         | every port, its adapters and settings                                                                                                                                                         |
| `POST /api/v1/connectors/{port}/verify`  | admin                          | check the running adapter or a candidate                                                                                                                                                      |
| `POST /api/v1/connectors/state/verify`   | the admin token, in setup mode | check a candidate database before you set it: `{"fields": {"dsn": "postgres://…"}}` → `{port, ok, kind, detail}`. Outside setup mode the `{port}` route above answers the same path           |
| `PUT /api/v1/connectors/{port}/settings` | admin                          | save settings into the database; the replica that served it restarts (in the release after 0.3.6, every replica within about 15 s, and one following a run once that run ends, at most 3 min) |
| `POST /api/v1/connectors/notifier/test`  | admin                          | send a TEST alert to every sink                                                                                                                                                               |
| `POST /api/v1/connectors/secrets/sync`   | admin                          | record every existing token in the secret store                                                                                                                                               |
| `GET`, `PUT /api/v1/licence`             | viewer, admin                  | the tier; install or clear a key                                                                                                                                                              |
| `PUT /api/v1/licence/fleet`              | admin, `fleet` token           | the fleet's licence fact                                                                                                                                                                      |
| `GET /api/v1/fleet/overview`             | viewer                         | fleet mode only                                                                                                                                                                               |
| `GET /api/v1/backup`                     | admin                          | a JSON-lines dump                                                                                                                                                                             |
| `POST /api/v1/restore`                   | admin                          | restore a dump; `?wipe=1`                                                                                                                                                                     |

```bash
curl -s -H "$H" "$CP/api/v1/backup" > opodcp-backup.jsonl
curl -s -H "$H" -X POST "$CP/api/v1/restore?wipe=1" --data-binary @opodcp-backup.jsonl
```

## Events

`GET /events` is a server-sent event stream: `event: <type>` and `data: {"ts","type","subject","data"}`, with a heartbeat comment every 15 s. A browser authenticates with a stream ticket (`?ticket=`); a script sends the header. Types include `endpoint.created`, `endpoint.updated`, `endpoint.deleted`, `plan.applied`, `status.changed`, `run.started`, `run.step`, `run.step-progress`, `run.finished`, `alert.fired`, `alert.resolved`, `alert.acked`, `licence.updated`, `model.added`, `model.deleted`, `key.created`, `key.revoked`, `auth.login`, `auth.login_failed`, `user.created`, `auth.user_deleted`, `endpoint.cert-renewed`, `endpoint.template-drift`, `connector.saved`, `connector.changed`.
