About this project

AI Switch is a self-described “local AI API Key hub” for people who juggle relay or multi-vendor API keys across several AI coding tools. Its pitch is that changing a key once should propagate to every installed tool, and that a broken key should not take the whole stack down. It positions itself as a manage / probe / push utility rather than a chat client. What it does - Key store: multi-vendor key table with search, tags, batch enable/disable/delete, batch import, “MetaAPI” merge and dedupe, so keys live in one place instead of being hand-edited in several config files. - Health and endpoint checks: scheduled health monitoring with model-level endpoint detection (Chat, Responses, Messages, Gemini), vendor-grouped quality checks with per-vendor and per-model actions, readable errors, adaptive check intervals, optional auto-disable and primary/backup failover, plus an archive of dead keys. - Safe sync: only models with a recent successful health and endpoint check are pushed to backends; a sync preview is shown before writing, and tools that are not installed are never written to. The README notes that quality checks send four short requests per model and may consume provider quota, and that endpoint support is detected per model — automatic mode uses verified endpoints while manual mode lets you pick among detected formats. Supported backends OpenClaw (openclaw.json, auth profiles, models), OpenCode (auth.json, opencode.jsonc), Claude Code (settings.json, ~/.claude.json), Codex CLI (auth.json, config.toml plus Responses health), Cline / Aider / Continue.dev (IDE and CLI configs), and Hermes Agent, QwenCode, Kimi Code and TRAE Work as documented in docs/backends.md. The Backends page reports each one as Not installed, Stopped (syncable) or Running. Endpoint families listed are openai_chat (OpenAI, DeepSeek, OpenRouter, Groq, Moonshot, Qwen and similar), anthropic, gemini and openai_responses. The feature list also mentions 26+ built-in providers plus custom OpenAI-compatible endpoints, and drop-in backend adapters with a contribution guide. Interface and extras A web UI with dashboard, backends sync status, health monitor, a non-blocking task center, light and dark themes, and English / Simplified Chinese / Traditional Chinese localization. Also included: vendor types (Public / Relay / Raw key) with filtering in the model catalog and check-in, archiving (hide, exclude from health checks, restore later), check-in URLs, budgets, encrypted profile export, diagnostics pack, downstream routes and desktop packages. Install and run - Releases builds for Windows x64, macOS Intel, macOS Apple Silicon and Linux x64: extract and run ai-switch / start.bat / start.sh, then open http://127.0.0.1:8787. - From source: git clone, pip install -r requirements.txt, python3 run.py (Python 3.9+). - npm/npx launcher: npx github:kingkate2009-droid/ai-switch, or a global install. - Docker: docker compose up -d. A documented “3-minute loop” is: add vendor and key (or smart import), let the health check pass, push to backends with preview first, then send `hi` from OpenCode / Codex / Claude Code. Configuration and security Data is stored at ~/.ai-switch/ai-switch.db and usage at ~/.ai-switch/usage.json; the default port is 8787 (AI_SWITCH_PORT). The README states keys live only under ~/.ai-switch/ and that this directory should never be committed, and mentions an optional access token in Settings for LAN exposure. Existing data.json state is imported once, with legacy files kept under a .legacy suffix for rollback. The configured port is fixed: startup exits with a clear error if it is occupied. State storage is transactional SQLite. Stack and license: Python + Flask, vanilla JS, SQLite, pluggable adapters; Apache 2.0. Documentation covers a quickstart, a Codex connectivity troubleshooting page, the backends matrix and an adapter contribution guide.