Skip to main content

Crate link_assistant_router

Crate link_assistant_router 

Source
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 / ForgeFed endpoint 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 OpenAI SSE 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 clients CLI 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
Crater ForgeFed task provider.
doctor
Subscription diagnostics shared by the doctor CLI command.
durable_file
Owner-only, crash-durable file replacement and inter-process locking.
gemini
Google Gemini (Code Assist) subscription upstream.
gemini_bridge
Native Gemini ↔ OpenAI Chat 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_tokens for 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
OpenAI Responses-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_tokens budgets.
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 with and with-router.

Constants§

VERSION
Package version (matches Cargo.toml version).