About this project

Token Station is a local routing control plane for AI agents and LLM providers. It runs as a Rust-based gateway on `127.0.0.1:8787`, keeping all request traffic on the local machine and only forwarding it to cloud providers when explicitly routed. Key capabilities: - **Local gateway**: Listens only on loopback by default with authentication enabled. Provider credentials are stored in an owner-only `secrets.json` file and never exposed in logs or plugins. - **Three routing modes**: Direct pins a single provider/model, Smart tiers select High/Mid/Low based on a single decision, and Quota first spends buckets that reset sooner. - **Provider support**: Comes with 40+ editable presets, supports custom OpenAI-compatible endpoints, and can route to local runtimes like Ollama. - **Agent connectors**: Built-in connectors for Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, Kimi Code, DeepSeek Harness, Hermes Agent, OpenClaw, WorkBuddy, OpenCode, and Cursor (macOS-only setup currently). Connectors write a bounded plan and private snapshot; disconnecting removes only Token Station fields. - **Sandboxed adapters**: Official WASM plugins cover Anthropic Messages, OpenAI Chat Completions, OpenAI Responses, Gemini, and OpenAI-compatible providers with no network, filesystem, or credential access. - **Usage tracking**: Logs prompt/response bodies and bounded redacted HTTP traces locally. Usage, latency, cost estimates, and request logs stay on the machine. - **Enterprise managed routing**: Supports entering an enterprise Base URL and credential once, letting the enterprise service retain control over real models and routing policy. The project ships both a desktop app (macOS, Windows, Linux) and a CLI, both sharing the same Rust core. Closing the window hides the app while the gateway keeps running; restore from the menu-bar or system-tray icon. Install from source requires Rust stable (MSRV 1.96), Node.js 22.23.1, and the `wasm32-wasip2` target.