Skip to content

Runtime management

Runtime management stores operational entities in the database and compiles them into an immutable dynamic view. When a change is accepted, the server builds a new snapshot and rebinds it for subsequent requests.

Admin operations use a configured provider. The static-token provider reads a Bearer token from an environment variable. Keep that token separate from proxy keys and rotate it through the deployment secret mechanism.

The admin API manages:

  • Upstreams, including API-key and OAuth credentials.
  • Principals, allowed models, limits, and cache-keepalive settings.
  • Proxy keys issued for principals.
  • Plugin registry entries and principal plugin chains.
  • Status and export views.

Use If-Match or the current revision for updates and deletes. A stale_revision response means another writer changed the resource; fetch the resource again before retrying.

A local proxy key file is a client-side cache of the plaintext key returned once by the key-issue endpoint. To rotate it, issue the replacement, write the file atomically with mode 0600, verify a request with the replacement, then revoke the old key.

The server does not rewrite operator key files automatically.

A successful runtime update rebuilds the routing view. In a multi-replica Postgres deployment, replicas use database notifications and a periodic reconciliation fallback to converge their local views.

The consistency contract source notes list what each admin response guarantees about persistence, audit records, the routing-view rebuild, and convergence across replicas.

/healthz on the proxy listener answers 200 once the process is up. /readyz answers 200 only when the server has started, at least one principal is active, and at least one upstream is usable: enabled, applied, and, for OAuth, holding decryptable credentials that do not need a reconnect. Otherwise it answers 503 with reason set to draining, startup_not_ready, no_ready_principal, or no_ready_upstream.

One broken OAuth upstream does not take a ready instance out of rotation. Routing skips it, and /readyz stays 200 with reason: "oauth_credentials_not_decryptable". API-key preflight results, capability snapshots, and usage-report failures are not part of readiness; check them on the upstream instead.