---
title: "Admin API (/admin/v1)"
description: "Every /admin/v1 route a leader serves, the request and response bodies, which routes are stable, and the capability flags."
url: "https://opod.io/docs/core-reference/admin-api/"
markdown_url: "https://opod.io/docs/core-reference/admin-api.md"
section: "Core reference"
last_updated: "2026-11-08"
---

# Admin API (/admin/v1)

> Every /admin/v1 route a leader serves, the request and response bodies, which routes are stable, and the capability flags.

## In short

The admin API, `/admin/v1`, is how the CLI and any external manager drive a leader: nodes, models, gangs, keys, streams and capabilities. Every route needs an `admin` key (worker register and heartbeat also take a `node` key). The routes that `GET /admin/v1/capabilities` lists are the stable contract.

```bash
curl -s http://localhost:8080/admin/v1/version -H "Authorization: Bearer $ADMIN"
```

The admin API is how the CLI and any external manager drive a leader. Front doors (`--role gateway`) and cell doors do not serve it.

## Authentication

Every route needs a key. All routes need `admin` scope, except `POST /admin/v1/nodes/register` and `POST /admin/v1/nodes/heartbeat`, which also accept a `node` key. `auth.require_keys: false` does not open `/admin/v1`.

```bash
ADMIN="sk-orc-<your-admin-key>"
curl -s http://localhost:8080/admin/v1/nodes -H "Authorization: Bearer $ADMIN"
```

A key without `admin` scope gets `403 forbidden` ("Insufficient scope"). Errors have the shape `{"error": {"message": "…", "type": "…", "code": "…"}}`; `code` appears only where there is a machine-readable cause. Request bodies are capped at 1 MiB. Every state-changing admin call (any method but `GET` and `HEAD`, except the heartbeat) is recorded in the event stream as `admin.call`, with the actor, the status and the caller's address.

## Stable routes

Routes marked **stable** below are the contract version `v1`. They are never removed, renamed or given another method, and their responses only gain fields. One exception was made by decision: `GET /admin/v1/usage/stream` leaves in core v0.4.0, replaced by the [usage push](https://opod.io/docs/core-reference/streams/#usage-push). `GET /admin/v1/capabilities` returns the list. Other routes may change between releases.

## Discovery

| Method | Path                     | Stable | Response                                                                                                                                                                                                                                                           |
| ------ | ------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GET`  | `/admin/v1/version`      | yes    | `{"version": "0.21.0", "contract": "v1"}`                                                                                                                                                                                                                          |
| `GET`  | `/admin/v1/capabilities` | yes    | `{contract, routes: [{method, path}], features: {name: true}, engines: [{id, aliases, native}]}`                                                                                                                                                                   |
| `GET`  | `/admin/v1/status`       |        | `{role, engine: {name, endpoint, reachable, error}, nodes, models_installed}`                                                                                                                                                                                      |
| `GET`  | `/admin/v1/config`       |        | Effective configuration, secrets redacted. Read-only.                                                                                                                                                                                                              |
| `POST` | `/admin/v1/healthcheck`  | yes    | Sends one real completion (the prompt `ping`, streamed, 30-second bound) through the router and reports whether it answered, how fast, and which engine. Optional body `{"model", "max_tokens"}`: `model` defaults to `router.default_model`, `max_tokens` to `5`. |

### Capabilities

`features` lists the mechanisms this binary ships, so a manager can probe for one instead of guessing from the version. `opod version --features` prints the same keys. The 89 keys of core v0.4.3:

```text
adapters_runtime admission_classes admission_hold admission_kv_bound anthropic_messages auth_file
auth_snapshot_age auth_tombstones boot_id cache_prune cache_salt card_mib door engine_liveness
engine_overhead engine_ttft engines events_stream fetch_snapshot gang_devices_per_rank gang_load
gateway_spend grpc_vertex heartbeat_no_report kv_block_events kv_cpu_tier_hits kv_peer_hits
kv_readback kv_tier_fs kv_tier_load load_pull load_signals loadz loadz_ttft lora model_move
model_revision mtls node_drain openai_passthrough otlp_logs pd_handoff pd_roles placement_drain
plain_listen plan_file plan_heal_gangs policy_file probe_header probe_port registry_rebuilding
request_wake rerank resident_models response_format router_only_ready routing_load_aware
routing_weights self_load session_routing shard_create_error_codes shard_expert shard_groups
shard_head shard_heal_failed_event shard_sglang shards slot_admission sticky_ttl_policy stream_boot
tier_ghost tls_listener tool_calls tool_parsers trace_sample_ratio ttft usage_push vertex vision
vllm_metric_aliases vram_budget wake_no_resume worker_devices worker_drain worker_engine
worker_goodbye worker_readyz worker_sleep worker_unload
```

Core v0.4.7 adds `gang_kv_events` (a vLLM Ray or SGLang gang publishes its prefix-cache events from its head) and `otlp_headers` (`OPOD_OTLP_HEADERS` on trace and log exports; an endpoint keeps its URL path).

`kv_cpu_tier_hits`, `sticky_ttl_policy` and `registry_rebuilding` joined in core v0.4.0; `load_pull` and `session_routing` in v0.4.3. `kv_block_salt`, `prefix_depth`, `routing_token_weight` and `worker_slow` arrive in the core release after v0.4.8.

In core v0.4.0, `usage_stream` leaves this list and `usage_push` joins it: the leader pushes its usage records over OTLP instead of serving them by cursor. It is the one key ever taken out. Probe for `usage_push` before you rely on the push; a leader without it serves the usage stream. See [Usage push](https://opod.io/docs/core-reference/streams/#usage-push).

`registry_rebuilding` also joins the list in core v0.4.0. A leader that boots with no workers in its store (a managed leader keeps them in memory, so that is every restart) marks `GET /admin/v1/nodes` with the header `X-Opod-Registry: rebuilding` until 15 seconds (three worker heartbeats) after the first worker registers again, and at most 2 minutes after boot. The clock starts at that first worker, not at boot, because workers reach a new leader only once its Service routes to it. Until then the list may still miss live workers, or the models they hold. A front door that reads the mark adds what the list names and removes nothing.

`engines[].native` is the catalog source field the engine serves a model by: `ollama_name`, `repo`, `path` or `id`.

## Nodes

| Method   | Path                           | Stable | Notes                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------- | ------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET`    | `/admin/v1/nodes`              | yes    | Every node with its live `state`, `heartbeat_age_seconds`, `cooldown_until`, resident `placements`, `slots`, `in_flight`, the last engine `load` sample and the engine process state. Includes each worker's token. After a boot with an empty registry the answer carries `X-Opod-Registry: rebuilding` until 15 s after the first worker registers again (feature `registry_rebuilding`, core v0.4.0). |
| `POST`   | `/admin/v1/nodes/register`     | yes    | Worker registration (node or admin key).                                                                                                                                                                                                                                                                                                                                                                 |
| `POST`   | `/admin/v1/nodes/heartbeat`    | yes    | Worker heartbeat (node or admin key).                                                                                                                                                                                                                                                                                                                                                                    |
| `POST`   | `/admin/v1/nodes/{id}/drain`   | yes    | No new requests or gang parts; in-flight finishes. Survives heartbeats and re-registers. `local` is refused.                                                                                                                                                                                                                                                                                             |
| `POST`   | `/admin/v1/nodes/{id}/undrain` | yes    | Back in rotation.                                                                                                                                                                                                                                                                                                                                                                                        |
| `POST`   | `/admin/v1/nodes/{id}/sleep`   | yes    | The worker's engine drops its GPU working set and keeps the process (vLLM sleep mode). Engines without one answer `501`.                                                                                                                                                                                                                                                                                 |
| `POST`   | `/admin/v1/nodes/{id}/resume`  | yes    | Wake it. A request for a sleeping model also wakes a worker: the leader holds the request up to 3 seconds.                                                                                                                                                                                                                                                                                               |
| `DELETE` | `/admin/v1/nodes/{id}`         |        | Forget a node and its placements.                                                                                                                                                                                                                                                                                                                                                                        |

## Models

| Method   | Path                           | Stable | Notes                                                                                                          |
| -------- | ------------------------------ | ------ | -------------------------------------------------------------------------------------------------------------- |
| `GET`    | `/admin/v1/models`             | yes    | Installed models.                                                                                              |
| `GET`    | `/admin/v1/catalog`            |        | The merged catalog as loaded at start, as JSON entries. A file added to an override directory needs a restart. |
| `POST`   | `/admin/v1/models`             |        | Install. Body below.                                                                                           |
| `DELETE` | `/admin/v1/models/{id}`        |        | Uninstall; a sharded model's gangs are torn down.                                                              |
| `POST`   | `/admin/v1/models/{id}/load`   | yes    | Load under admission control. Body below.                                                                      |
| `POST`   | `/admin/v1/models/{id}/unload` |        | Drain, then drop from engine memory. Engines without unload answer `status: "noop"`.                           |
| `POST`   | `/admin/v1/models/{id}/move`   | yes    | Move a whole model between workers by overlap. Body below.                                                     |
| `GET`    | `/admin/v1/memory`             |        | Live engine residency, free memory, and the desired set (what `opod model ps` prints).                         |

**Install** — `POST /admin/v1/models`:

```json
{ "id": "llama-3.2-3b", "nodes": ["n_abc123"], "force": false }
```

`id` may be a catalog id or a scheme id (`hf:…`, `ollama:…`, `file:…`). `nodes` pulls and loads on those workers. `200 {"status": "ready", "id", "kind"}` where `kind` is `sharded`, `node` or `local`. `404` for an unknown id or a source that does not exist; `409` when a one-model worker serves another model (send `"force": true`); `502` for an upstream failure.

**Load** — `POST /admin/v1/models/{id}/load`:

```json
{ "swap": false, "pin": false, "priority": 0 }
```

An empty body means the defaults. `200 {"status": "loaded", "id", "plan"}`. `409` with `error.type` `needs_swap` (retry with `swap: true`; `plan` lists the victims) or `blocked_by_pinned`; `422 impossible` when the model exceeds the empty budget; `404` when not installed.

**Move** — `POST /admin/v1/models/{id}/move`:

```json
{ "from": "n_abc123", "to": "n_def456", "ready_timeout_seconds": 1800, "drain_timeout_seconds": 30 }
```

Synchronous. `200 {model, from, to, steps[], note?}`; `404` unknown model or node; `409` a refusal before anything changed (the reason is the message); `502 {error, steps[]}` a move that aborted, where the last step says what serves now.

## Adapters

| Method   | Path                        | Stable | Notes                                                                                                                                                                                   |
| -------- | --------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST`   | `/admin/v1/adapters`        | yes    | `{"name", "source", "rank"}`: load a LoRA adapter on every worker that holds the plan's model. Answered per worker (`207` when only some took it). `409` on a leader with no plan file. |
| `DELETE` | `/admin/v1/adapters/{name}` | yes    | Drop one.                                                                                                                                                                               |

## Tokens

| Method   | Path                    | Notes                                                                                                                                        |
| -------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET`    | `/admin/v1/tokens`      | `[{id, name, scope, user_id, expires_at?, revoked, created_at}]`. No hash, no plaintext.                                                     |
| `POST`   | `/admin/v1/tokens`      | Create. Body `{name, scope, user_id?, expires_at?, ttl_seconds?}`; `scope` is `admin`, `user` (default) or `node`. Returns `plaintext` once. |
| `PATCH`  | `/admin/v1/tokens/{id}` | Change expiry only: `{"ttl_seconds": N}` (`0` or less = never) or `{"expires_at": "RFC 3339" \| null}`.                                      |
| `DELETE` | `/admin/v1/tokens/{id}` | Revoke.                                                                                                                                      |

```bash
curl -s -X POST http://localhost:8080/admin/v1/tokens \
  -H "Authorization: Bearer $ADMIN" -H "Content-Type: application/json" \
  -d '{"name":"ci-bot","scope":"user","ttl_seconds":604800}'
```

## Shards

| Method   | Path                                    | Stable | Notes                                                                                                                                                                           |
| -------- | --------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET`    | `/admin/v1/shards`                      | yes    | Every gang part and coordinator: `ID`, `ModelID`, `GangID`, `Role` (`coordinator` or `rpc`), `NodeID`, `Address`, `ProcessID`, `Status`, `ConfigJSON`, `CreatedAt`, `LastSeen`. |
| `GET`    | `/admin/v1/shards/processes`            |        | Process state of the parts the leader supervises: `running`, `starting`, `stopped`, `failed`, `crashloop`.                                                                      |
| `POST`   | `/admin/v1/shards/create`               | yes    | Form a gang. Body below.                                                                                                                                                        |
| `DELETE` | `/admin/v1/shards/{model_id}`           | yes    | Tear down every gang of the model.                                                                                                                                              |
| `DELETE` | `/admin/v1/shards/{model_id}/{gang_id}` | yes    | Tear down one gang. `404` when the model has no such gang.                                                                                                                      |

**Create** — `POST /admin/v1/shards/create`:

```json
{
  "model_id": "llama-3.3-70b-sharded",
  "shards": 2,
  "nodes": ["n_a", "n_b"],
  "tp": 0,
  "pp": 0,
  "devices": 1,
  "head": "n_a",
  "gang": "g1",
  "flags": { "ctx": "8192" },
  "expert": false
}
```

| Field      | Meaning                                                                                                  |
| ---------- | -------------------------------------------------------------------------------------------------------- |
| `model_id` | Catalog id. Required.                                                                                    |
| `shards`   | Part count. Without it and without `nodes`: the catalog's `default_shards`. The API never picks a count. |
| `nodes`    | Workers for the parts, in order.                                                                         |
| `tp`, `pp` | Tensor- and pipeline-parallel sizes (vLLM, SGLang).                                                      |
| `devices`  | GPUs per part (`0` = 1). `tp × pp` must equal parts × devices.                                           |
| `head`     | The worker that runs the coordinator. `local` is refused.                                                |
| `gang`     | Build this gang only; empty replaces every gang of the model.                                            |
| `flags`    | Engine flags for the gang's coordinator, same allow-list as `OPOD_ENGINE_FLAGS`.                         |
| `expert`   | vLLM expert parallelism; `pp` must be unset.                                                             |

`200 {"status": "ready", "model_id"}`. For `404`, `409` and `502` with `error.code` see [Sharding](https://opod.io/docs/core/sharding/#failures-and-recovery).

## Streams and events

| Method | Path                      | Stable | Notes                                                                                                                                                                                                                                                                                                 |
| ------ | ------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET`  | `/admin/v1/usage/stream`  | yes    | Usage rows by cursor: `?after=` (default `0`) and `?limit=` (default `500`, 1 to 1000; another value is the default). See [Streams](https://opod.io/docs/core-reference/streams/). Leaves core in core v0.4.0, replaced by the [usage push](https://opod.io/docs/core-reference/streams/#usage-push). |
| `GET`  | `/admin/v1/events/stream` | yes    | Lifecycle events by cursor, with the same `?after=` and `?limit=`. See [Streams](https://opod.io/docs/core-reference/streams/#event-stream).                                                                                                                                                          |
| `GET`  | `/admin/v1/events`        |        | Server-sent events: push on change, for live views.                                                                                                                                                                                                                                                   |

## Front doors

| Method | Path                   | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `POST` | `/admin/v1/usage/push` | A front door's usage rows, deduplicated by the row id the door mints. Also the door's heartbeat, with its `in_flight` and `rpm_1m`. Body (at most 1 MiB): `{gateway, rows: [{id, ts, api_key_id, user_id, model, protocol, prompt_tokens, completion_tokens, latency_ms, ttft_ms, outcome, node_id}], in_flight, rpm_1m}`; the row fields mean what they mean on the [usage stream](https://opod.io/docs/core-reference/streams/#usage-stream). From core v0.4.0 the leader adds the door's rows to its own usage queue for the [usage push](https://opod.io/docs/core-reference/streams/#usage-push), and a row may also carry `cached_tokens`, `class` and `operation`. |
| `GET`  | `/admin/v1/spend`      | The snapshot each door polls: `{ts, doors, gateways, lag_bound_ms}`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `GET`  | `/admin/v1/gateways`   | `{doors, live_for_s, lag_bound_s, dedup_window, leader_is_door, gateways}`: `gateways` lists the doors the leader has heard from, each `{gateway, live, last_push_s, last_push_ts}`, including one that stopped pushing.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## Response cache

| Method   | Path                    | Notes                                                                                                                                                                                                                                                                                                                               |
| -------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET`    | `/admin/v1/cache/stats` | `{"enabled": true, "stats": {…}}`: driver and counters. With no response cache configured: `200 {"enabled": false}`.                                                                                                                                                                                                                |
| `DELETE` | `/admin/v1/cache`       | Flush. `?namespace=NAME` for one namespace, `?all=1` for everything; without either: `400`. Answers `{"status": "flushed", "namespace", "all"}`. With no response cache configured it answers `200` with an error body, `{"error": {"message": "cache_disabled", "type": "invalid_request"}}`: check the body, not only the status. |
