Expand description
Link.Assistant.Router — Claude MAX OAuth proxy and token gateway.
A Rust-based API gateway that proxies Anthropic (Claude) APIs, supports Claude MAX OAuth sessions, and provides multi-tenant access via custom-issued tokens.
Modules§
- accounts
- Multi-account OAuth credential routing.
- accounts_
cli - The
accountssubcommand: report what each configured account can do. - activitypub
- Minimal
ActivityPub/ForgeFedendpoint support. - admin
- Admin credential claim state — the two-phase first-visitor bootstrap.
- admin_
api - HTTP surface of the admin UI: the bootstrap claim, credential rotation, and read-only status, plus the router that serves them on the dedicated admin port.
- admin_
auth - Authorisation decision for the administrative endpoints.
- admin_
config - Configuration for the opt-in admin UI listener.
- admin_
ui - Serving of the embedded admin UI bundle.
- anthropic_
bridge - Anthropic Messages surface over non-Anthropic upstreams.
- anthropic_
stream - Incremental
OpenAISSE to Anthropic SSE translation. - app_
state - Shared state used by HTTP route handlers.
- audit
- Append-only per-token audit log.
- auth
- Provider-aware native Claude and Codex subscription authorization.
- auth_
remote - Authorize the subscription of the selected router, not a local directory.
- bridge_
selection - Deterministic bridge-model selection from live provider catalogs.
- capabilities
- Central capability declarations for request reconciliation and bridges.
- chat_
admin - Transport-agnostic core of the optional chat admin channels.
- chat_
commands - The administrative commands reachable from a chat channel.
- chat_
config - Configuration for the optional chat admin channels.
- claude_
auth - Native Claude OAuth authorization using the public Claude Code client.
- claude_
identity - Claude Code request identity used for OAuth inference and account probes.
- cli
- Command-line interface for the router.
- client_
command - Output and dispatch layer for the
clientsCLI command. - client_
global - Exact, edit-aware backup and undo for
router with --global. - client_
policy - Client-bound authorization for consumer subscription credentials.
- clients
- Safe local configuration for agentic CLI clients.
- codex_
identity - Exact HTTP identity used by the supported Codex client.
- codex_
loopback_ bridge - Loopback transport accepted by Codex’s remote-control origin policy.
- config
- Configuration module for Link.Assistant.Router.
- config_
defaults - Provider-specific default constructors used by
crate::config. - configure
- Permanent client setup: one name, one targeting rule, one reversal.
- conversation_
record - Opt-in recording of client-to-Router conversations, and strict replay of one.
- conversations
- Authenticated native
OpenAIConversations and conversation-items lifecycle. - crater
CraterForgeFedtask provider.- credential_
acceptance - Staged, non-inference acceptance for credentials that may replace a primary.
- credential_
recovery_ store - Durable fallback storage for refreshed subscription credentials.
- credential_
status - Shared local/remote subscription credential acceptance checks.
- credential_
store - Where a subscription credential lives, so every refresh path can re-read it, lock it, and write a rotated refresh token back.
- doctor
- Subscription diagnostics shared by the
doctorCLI command. - durable_
file - Owner-only, crash-durable file replacement and inter-process locking.
- entrypoint
- Running the asynchronous entry point on a stack this crate controls.
- env_
paths - Reading directory paths from the environment.
- gemini
- Google Gemini (Code Assist) subscription upstream.
- gemini_
bridge - Native Gemini ↔
OpenAIChat Completions translation. - git_
proxy - Git smart-HTTP proxy with ref-update policy.
- github_
proxy - GitHub API credential proxy with a deny-by-default destructive policy.
- gonka
- Gonka upstream provider support.
- lefine
- Lefine’s persisted
OpenAIChat Completions provider contract. - lino_
json - Persist
serde-shaped state as readable links notation. - log_
analysis - Answer questions about the request log.
- log_
decode - Decoding of stored response bodies for log inspection.
- logging
- Tracing filter construction shared by the binary and regression tests.
- login
- Login sessions that authorize a deployment without a pre-existing credential file.
- login_
api - HTTP endpoints for authorizing a deployment (issue #47).
- login_
pty - Long-lived PTY sessions for driving an interactive terminal program.
- login_
url - Extraction of the authorization URL and the resulting token from a terminal transcript.
- managed_
server - Server selection, managed Docker lifecycle, and per-run token handling.
- metrics
- Live metrics and operational endpoints.
- model_
catalog - Live subscription model discovery with stale-on-error caching.
- model_
resource - Authenticated single-model retrieval from native or fresh live catalogs.
- model_
routing - Model catalog and automatic subscription-provider routing.
- monitoring_
api - Monitoring endpoints served on the proxy port.
- mpp
- Machine Payments Protocol helpers for paid OpenAI-compatible endpoints.
- oauth
- Claude MAX OAuth credential reader.
- on_
demand_ cli - Disposable package-runner environments for vendor CLI compatibility.
- openai
- OpenAI-compatible API surface.
- output_
limit - Local emulation of
max_output_tokensfor backends that reject the field. - platform_
keychain - The platform secret store a vendor CLI keeps its live subscription in.
- primary_
listener - Explicit primary listener configuration.
- provider_
acceptance - Transactional acceptance for persisted upstream providers.
- provider_
proxy - OpenAI-compatible provider API and forwarding helpers.
- providers
- Provider configuration storage.
- providers_
cli router providers— manage stored OpenAI-compatible providers.- proxy
- Transparent API proxy for forwarding requests to upstream APIs.
- refresh
- OAuth refresh and durable rotation handling for vendor subscriptions.
- refresh_
rejections - Which credentials a refresh has already been refused for, across restarts.
- remote_
command - One targeting rule for every command that reads or changes router state.
- request_
log - Redacted, size-bounded HTTP exchange logging.
- responses
OpenAIResponses-API (POST /v1/responses) request/response translation.- responses_
lifecycle - Stored
OpenAI Responsesresource lifecycle proxying. - responses_
websocket - Native
OpenAIResponses WebSocket forwarding with a pinned provider. - route_
contract - Canonical HTTP route classification and endpoint construction.
- security_
headers - Response hardening for the admin listener.
- server_
command - CLI output layer for
router server. - server_
router - Network-facing route construction from the canonical route contract.
- stop_
sequences - Local stop-sequence enforcement for backends that cannot accept
stop. - storage
- Token persistence backends.
- subscription
- Subscription OAuth credential readers for vendor coding CLIs.
- subscription_
health - Subscription health reporting (issue #318).
- subscription_
proxy - Forward
OpenAI-style requests to vendor subscription upstreams. - subscription_
usage - subscription_
usage_ cli - Formatter and HTTP client shared by local and selected-remote usage commands.
- telegram
- Telegram admin channel — a long-polling loop over the Bot API.
- tls
- Optional TLS termination in the router itself.
- tls_cli
router tls— manage the certificate a self-signed deployment serves.- token
- Custom token management for the gateway layer.
- token_
admin - Admin HTTP endpoints for managing router-issued tokens.
- token_
report - How
router tokens listrenders, for local and remote alike. - token_
reservation - Pre-dispatch spend reservations for per-token
max_tokensbudgets. - token_
secret - The stand-in used when a command will never sign anything.
- tokens_
remote router tokensagainst the selected router.- unix_
listener - Serving the router on a unix domain socket.
- upstream_
client - Construction of the shared HTTP client used for every upstream call.
- usage
- Upstream usage extraction for per-token spend budgets.
- vendor_
cli_ refresh - Last rung of the recovery ladder: let the vendor’s own CLI rotate the chain.
- vk
- VK admin channel — a long-polling loop over the Bots Long Poll API.
- with_
command - Temporary-by-default launcher shared by
router withandwith-router. - zai_
coding_ plan - Policy and exact model registry for the experimental z.ai GLM Coding Plan.
Constants§
- VERSION
- Package version (matches Cargo.toml version).