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.
- 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 interactive subscription authorization.
- 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 identity system prompt required by Claude MAX OAuth inference.
- 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. - clients
- Safe local configuration for agentic CLI clients.
- config
- Configuration module for Link.Assistant.Router.
- config_
defaults - Provider-specific default constructors used by
crate::config. - crater
CraterForgeFedtask provider.- doctor
- Subscription diagnostics shared by the
doctorCLI command. - durable_
file - Owner-only, crash-durable file replacement and inter-process locking.
- gemini
- Google Gemini (Code Assist) subscription upstream.
- gemini_
bridge - Native Gemini ↔
OpenAIChat Completions translation. - github_
proxy - GitHub API credential proxy with a deny-by-default destructive policy.
- gonka
- Gonka upstream provider support.
- 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_
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. - provider_
proxy - OpenAI-compatible provider API and forwarding helpers.
- providers
- Provider configuration storage.
- proxy
- Transparent API proxy for forwarding requests to upstream APIs.
- refresh
- In-memory OAuth refresh for vendor subscription tokens.
- request_
log - Redacted, size-bounded HTTP exchange logging.
- responses
OpenAIResponses-API (POST /v1/responses) request/response translation.- security_
headers - Response hardening for the admin listener.
- server_
command - CLI output layer for
router server. - server_
router - Network-facing proxy router construction.
- 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_
proxy - Forward
OpenAI-style requests to vendor subscription upstreams. - telegram
- Telegram admin channel — a long-polling loop over the Bot API.
- token
- Custom token management for the gateway layer.
- token_
admin - Admin HTTP endpoints for managing router-issued tokens.
- token_
reservation - Pre-dispatch spend reservations for per-token
max_tokensbudgets. - upstream_
client - Construction of the shared HTTP client used for every upstream call.
- usage
- Upstream usage extraction for per-token spend budgets.
- 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.
Constants§
- VERSION
- Package version (matches Cargo.toml version).