Core reference
Front doors and cell doors
Run extra gateway copies for one endpoint with --role gateway, or one URL for many endpoints with --role door and its routes file.
In short
A front door (opod up --role gateway) is an extra copy of one leader's gateway: it checks keys and routes to that leader's workers itself, so several of them spread client connections. A cell door (opod up --role door) is one URL in front of many leaders: it reads each request's model and forwards it, unchanged, to that endpoint.
OPOD_ADMIN_TOKEN=sk-orc-<admin-key> opod up --role gateway --leader http://leader:8080
opod up --role door --routes /etc/opod-door/routes.jsonOpod has two kinds of door. Both are opod up with a --role.
| Aspect | Front door (--role gateway) | Cell door (--role door) |
|---|---|---|
| Serves | one leader's endpoint | many endpoints, chosen by model |
| Routes to | that leader's workers, itself | the endpoint's leader, unchanged |
| Checks keys | yes, like the leader | no; the endpoint's leader checks them |
| Store, engine | none of its own | none |
| Needs | --leader / OPOD_LEADER_URL and OPOD_ADMIN_TOKEN | --routes / OPOD_DOOR_ROUTES |
Front door
OPOD_ADMIN_TOKEN=sk-orc-<admin-key> opod up --role gateway --leader http://leader:8080A front door is an extra copy of the gateway for one endpoint. Run several behind a load balancer when one leader process should not carry every client connection.
- It serves
/v1and the probes only. No/admin/v1, no join surface, no engine. The worker registry, join tokens and gang calls stay with the leader. - It mirrors the leader's worker list and gangs (
GET /admin/v1/nodes, which includes the worker tokens it needs to sign calls, andGET /admin/v1/shards) and routes to those workers itself. - It pushes its usage rows to the leader with
POST /admin/v1/usage/push. The leader is the single writer of usage; rows are deduplicated by an id the door mints. The push also carries the door'sin_flightandrpm_1m. From core v0.4.0 the leader adds the door's rows to its own queue for the usage push, so they reach the receiver with the leader's. - It polls
GET /admin/v1/spendevery 10 seconds for the live door count. - It fails at start when it cannot reach its leader, rather than serving
503s that look like an outage. OPOD_GATEWAY_IDnames the door in the leader's count (default: the hostname).- Its
/loadzand its own time-to-first-token describe only its own traffic. Scale doors on the leader's/gatewayz, which totals all of them. See Probes.
Cell door
opod up --role door --routes /etc/opod-door/routes.jsonA cell door is a name lookup, not a router. For each request it reads model, finds the endpoint in the routes file and forwards the request there unchanged, streaming included. It chooses no worker. On a plain route it retries nothing and falls back to nothing. It holds no credential: Authorization goes through as received and the endpoint's leader checks it.
-
GET /v1/modelslists the models whose endpoint accepts the caller's key. -
An unknown model answers OpenAI's
404 model_not_found. -
The door's own errors use OpenAI's envelope,
{"error": {"message", "type", "param", "code"}}:Status error.typeCause 400invalid_request_errorThe body is not JSON, or not a JSON object when the door must rewrite model.400invalid_request_errorAn auto route: the request carries toolsand no candidate hastools: true.404invalid_request_error(code: model_not_found)No route for the model, or nomodelin the body.502upstream_unavailableThe endpoint did not answer the door (a plain route, or the last candidate of an auto route). The door does not retry. An auto route moves to the next candidate when one is unreachable, answers
429or5xx, or answers400for a context-length error. The last candidate's answer goes to the client as it is. -
It serves
GET /v1/models,GET /v1/models/{id}, everyPOST /v1/…(forwarded), and/healthz,/readyzand/gatewayz. Every other path is404. -
It opens no store, starts no engine and mints no admin key.
-
It re-reads the routes file every 10 seconds. A file that repeats an alias is refused, and the last good file stays in force.
Routes file
The typed shape is DoorRoutes in core's pkg/adminapi.
{
"revision": "2026-10-30.1",
"routes": [
{ "alias": "qwen-coder", "upstream": "https://coder.internal:8080", "model": "qwen3-coder-30b", "ca": "-----BEGIN CERTIFICATE-----\n…" },
{ "alias": "llama-3.2-3b", "upstream": "http://small.internal:8080" },
{
"alias": "chat",
"pick": "least-loaded",
"maxHops": 1,
"candidates": [
{ "alias": "big", "upstream": "https://big.internal:8080", "model": "qwen3-30b", "tools": true },
{ "alias": "small", "upstream": "http://small.internal:8080", "model": "llama-3.2-3b" }
]
}
]
}| Route field | Meaning |
|---|---|
alias | The name a client sends as model. Unique in the file. |
upstream | The endpoint's base URL: scheme://host:port, no /v1. |
model | When set and different from alias, the door rewrites the request's model to it and changes nothing else. Empty = the alias is the model id. |
ca | PEM certificates trusted for an https upstream — exactly these, never the system roots. Empty = system roots, or plain http. |
candidates[] | Makes this an auto route: the door picks one candidate and falls back down the list on an unavailable answer. upstream, model and ca of the route are then unused. |
pick | first (default): the first candidate that can take the request. least-loaded: by each candidate's /loadz. |
maxHops | How many fallbacks one request may take. Default 1, at most len(candidates) - 1. |
| Candidate field | Meaning |
|---|---|
alias | The candidate's own name. The response's X-Opod-Endpoint header names the one that answered. |
upstream, model, ca | As for a plain route. |
tools | The candidate's model can call tools. A request that carries tools skips candidates without it. |
The revision the door serves from appears on its /gatewayz.
Last updated · Source: content/docs/core-reference/front-doors.mdx · View as Markdown