Janus¶
The two-faced gateway for AI coding tools. Janus sits at the threshold of every AI call — facing the developer on one side and every provider on the other.
Janus is a local-first, single-user AI routing gateway. It exposes OpenAI/Anthropic/Gemini-compatible HTTP endpoints that your coding tools (Claude Code, Codex, Cursor, Cline, ...) talk to, then translates and routes each request to any of 29 built-in AI providers — or any OpenAI-compatible endpoint — without either side needing to know the other exists.
Why Janus?¶
- One endpoint, every provider — point your tools at a single URL, route to OpenAI, Anthropic, Gemini, Groq, DeepSeek, Copilot, and more
- Automatic fallback — if one provider is rate-limited or down, Janus rotates to the next automatically
- Fusion combos — fan a request out to a panel of models in parallel and synthesize one answer with a judge model
- Key inventory — store and route across many upstream API keys with validation, credit checks, and multi-account expansion
- Cost tracking — per-request cost estimation with builtin model prices, budgets, and subscription quota windows
- Token savings — RTK compression, optional Headroom proxy, and prompt savers before routing, with per-saver savings metrics on the dashboard
- Per-provider model allowlists — expose only selected models from a provider, by exact name or glob
- Client-native surfaces — Chat Completions, Responses (Codex), Anthropic, Gemini, and Ollama endpoints
- Request-log user attribution — captured requests show which API key made each call
- No cloud, no telemetry — runs entirely on your machine, your keys never leave your system
Quick Start¶
Janus is operated from its dashboard, Cloudline. Start the server, sign in, and connect your credentials there.
pip install janus-ai
janus config-init
janus serve --port 20128
janus keys create --name admin # in a second terminal: your sign-in key, shown once
- Open the dashboard. Run
janus dashboardor visithttp://localhost:20128/dashboard/ui, then sign in with thesk-janus-...key. While setup is incomplete, Home shows a three-step checklist that links to each screen. - Connect credentials. On Connect, paste provider API keys or drop credential files. Janus previews each entry with masked values and a new / exists / rejected status before anything is stored. Import them with Make these routable on (the default). See Key Inventory — Connect.
- Point your client at the endpoint. The Your endpoint card on Home shows
the base URL (
http://localhost:20128/v1) and a copyablecurlrequest. Settings → Tools has ready-made settings for Claude Code, Codex, Cursor, and Cline.
What next?
- Dashboard — the six sections and every tab
- Getting Started — full install and first-request walkthrough
- Client Setup — connect Claude Code, Codex, Cursor, and more
- Providers — setup guides for all supported providers
Headless / automation¶
On a server without a browser, or for scripted setup, seed providers from YAML (Configuration), manage keys and budgets with the CLI, and push upstream keys through the inventory Push API.
Features¶
Fallback Routing¶
Multi-account rotation with intelligent cooldowns. When a provider returns 429, 5xx, auth, or network errors, Janus automatically tries the next available account or model. Cooldown state persists across restarts in SQLite.
Combos¶
Named ordered model sequences. A client sends "model": "best-effort" and Janus tries each model in the combo chain with all its accounts.
Key Inventory¶
Store, validate, and route with many upstream API keys across 27+ providers. Keys are auto-detected, rechecked on a schedule, and wired into gateway routing as multi-account pools. Per-account value — credit balances and provider usage windows (OpenRouter credits, Z.AI/GLM coding-plan quota, DeepSeek/Moonshot/Kimi balances, MiniMax/Venice plans, Synthetic/Ollama Cloud/Cline usage, Codex/Kiro/Antigravity/Claude OAuth subscription windows) — is probed from each provider's billing endpoint, rendered with usage bars and reset times, and raises alerts near exhaustion. See Key Inventory.
Token Savers¶
- RTK (default ON) — compresses tool output (git diffs, file listings, logs) before sending
- Caveman — prepends a brevity-maximizing system prompt
- Ponytail — prepends a lazy-developer prompt (3 levels: lite, full, ultra)
- Headroom — optional external conversation compression proxy (
/v1/compress), fail-open
Client surfaces¶
OpenAI Chat Completions, OpenAI Responses (/v1/responses for Codex CLI), Anthropic Messages, Gemini GenerateContent, and Ollama (/api/chat, /api/generate, /api/show, /api/tags). See Client Setup.
Budgets¶
Daily spending limits per API key or global. Warn at 80%, block at 100% with 429 + Retry-After. Managed via CLI or dashboard.
Analytics¶
Cost tracking, spend trends, success rates, and breakdowns by model, provider, account, or client key. Visualized in the dashboard with Chart.js.
Dashboard¶
Cloudline is the single dashboard UI and the primary way to operate Janus. It is
a responsive Svelte control plane at /dashboard/ui with six sidebar sections
(Home, Connect, Inventory, Routing, Usage, Settings). Each section groups its
pages as tabs, and every page keeps a deep link. It also has light/dark/system
themes and a command palette. Changes hot-reload without a server restart.
/dashboard and former page URLs are compatibility redirects to Cloudline. See
Dashboard.
Tech Stack¶
Python 3.11+ / FastAPI / httpx / Pydantic v2 / aiosqlite / SvelteKit 2 / Svelte 5 / TypeScript
License¶
Janus is licensed under the GPL-3.0 license.