# Router documentation Start with the task you need to complete: | Task | Documentation | |---|---| | Connect a coding tool to the hosted router | [Hosted setup](../README.md#get-started) and [installer flags](../install/npm/README.md) | | Run the router and database yourself | [Self-hosted setup](../README.md#run-it-yourself) | | Run the managed router and classifier on your own host | [Self-hosted production router](SELF_HOSTED.md) | | Configure a client, choose models, or switch routing off | [Installation guide](../install/README.md) | | Find API endpoints | [API overview](../README.md#api) and [endpoint reference](ENDPOINTS.md) | | Understand per-action routing | [Canonical semantics](SEMANTICS.md) | | Configure providers, credentials, or telemetry | [Configuration reference](CONFIGURATION.md) | | Read session costs and routing decisions | [Session cost](SESSION_COST.md) and [analytics export](ANALYTICS_EXPORT.md) | | Inspect cross-format behavior | [Translation compatibility](TRANSLATION_COMPATIBILITY.md) | Use the instructions for your deployment: the hosted quickstart and self-hosted stack have different setup and credential requirements. ## Engineering reference Index of Markdown documentation in the `router/` repo. | Doc | What it covers | |---|---| | [SEMANTICS.md](SEMANTICS.md) | **Canonical terminology** for sessions, rounds, turns, actions, and steps. Read this first before other docs. | | [ROUTER_ARCHITECTURE.md](ROUTER_ARCHITECTURE.md) | Serving and router layers, atoms with their owner packages, the strategy contract and the check that enforces each rule. | | [ENDPOINTS.md](ENDPOINTS.md) | API endpoints, health checks, and cost response fields. | | [CONFIGURATION.md](CONFIGURATION.md) | Environment variables, provider keys (gateways, model aliases, key-pair auth), BYOK encryption, OTel knobs. | | [INFERENCE_BOUNDARY.md](INFERENCE_BOUNDARY.md) | Inference operation inventory, policy-boundary exceptions, and staged migration enforcement. | | [POLICY_INFERENCE.md](POLICY_INFERENCE.md) | Generated static registry of inference purposes, selection policy, constraints, fallback, and migration status. | | [ANALYTICS_EXPORT.md](ANALYTICS_EXPORT.md) | Deprecated `/v1/analytics/*` raw routing-decision export: read-only keys, cursor paging, row grain, field reference. | | [ROUTING_OBSERVATION_SMOKE.md](ROUTING_OBSERVATION_SMOKE.md) | Staging smoke test and historical routing observation report. | | [SUBSCRIPTION_ROUTING.md](SUBSCRIPTION_ROUTING.md) | Personal and shared subscription candidate admission, alternatives, native OAuth dispatch with quota checks, and API fallback. | | [DELEGATED_SESSION_TOKENS.md](DELEGATED_SESSION_TOKENS.md) | Experimental `rs_` session JWTs signed by a registered Ed25519 issuer: token claims, issuer registration and revocation. | | [UPSTREAM_GATEWAY_SERVICE.md](UPSTREAM_GATEWAY_SERVICE.md) | Server-to-server mode for an upstream AI gateway: OIDC/JWKS inbound auth, decision-only `/v1/route` (model and effort), credential isolation and correlation headers. | | [TURN_SIGNALS.md](TURN_SIGNALS.md) | Turn signals, stuck-session detectors, telemetry row NULL conventions, cross-tokenizer usage reporting and the feedback footer. | | [SESSION_COST.md](SESSION_COST.md) | `GET /v1/sessions/:session_id/cost`: `rk_`/`ra_` auth, installation scope, response fields, errors, rate limit. | | [POLICY_ROUTER_HARNESS.md](POLICY_ROUTER_HARNESS.md) | Contract for out-of-process policy sidecars. | | [LLM_CLASSIFIER_CONTEXT.md](LLM_CLASSIFIER_CONTEXT.md) | Staged atomic-response classifier input contract and unresolved admission/recovery requirements; not serving-enabled. | | [SELF_HOSTED.md](SELF_HOSTED.md) | Production self-hosted compose: exported prod/stable serving graph, standalone and Weave-linked modes, verification, upgrade and rollback. | | [SERVING_CONTROL.md](SERVING_CONTROL.md) | Immutable managed releases, gateway admission, activation, rollback, and deployment prerequisites. | | [HMM_GO_SELECTION.md](HMM_GO_SELECTION.md) | Architecture, classifier-facts (`policy_router_v5`) split, and rollback story for Go-owned HMM roster ownership and deterministic arm selection. | | [FAILOVER.md](FAILOVER.md) | Proxy rescue chain, strikes and cooldowns, overload circuit, context overflow and dispatch error classification. | | [REQUEST_ENVELOPE.md](REQUEST_ENVELOPE.md) | Request envelope, emit overrides, model id normalization, in-band commands and history repair in `internal/translate`. | | [TRANSLATION_COMPATIBILITY.md](TRANSLATION_COMPATIBILITY.md) | Cross-format translation requirements and rollout modes. | | [TRANSLATION_REWRITES.md](TRANSLATION_REWRITES.md) | Why translation rewrites requests and responses: markers, footers, directives, reasoning, cache control, tool history. | | [RESPONSES_TRANSLATION.md](RESPONSES_TRANSLATION.md) | Responses API ingress, Codex portable projection, passthrough, and Responses-upstream translation for Anthropic and Chat clients. | | [ROUTER_NOTICES.md](ROUTER_NOTICES.md) | Typed router notices, client-protocol sinks, capabilities, and retry lifecycle. | | [SMOKE.md](SMOKE.md) | Pre-merge record/replay smoke-suite scenarios, cassettes, and local workflow. | | [CI.md](CI.md) | CI timing baseline, completed improvements, and the remaining optimization backlog. | | [PROXY_TURN_LOOP.md](PROXY_TURN_LOOP.md) | Turn-loop precedence, session-key derivation, force-model resolution and the handover credential boundary. | For engineering conventions (layer model, package layout, recipes), see the root [`CLAUDE.md`](../CLAUDE.md) (and its mirror [`AGENTS.md`](../AGENTS.md)).