Skip to content

Open source · MIT

One shell for every AI API

AI Switch brings the accounts, protocols, and capacity behind Codex, Claude Code, Gemini CLI, Grok and more into one place: a single local proxy entry, automatic pool scheduling, and on-demand upstream protocol bridging. The desktop app and the self-hosted web service share the same data.

7
agent platforms
4
upstream protocols
7
bridge routes
MIT
licensed
AI Switch screenshot

Supported platforms

Codex, Claude Code, Gemini CLI and Grok get native config writing and official account import. OpenCode, OpenClaw and Hermes connect through generic API routing, which still covers routing, terminal launch and session workflows.

  • CodexNative support
  • Claude CodeNative support
  • Gemini CLINative support
  • GrokNative support
  • OpenCodeGeneric API routing
  • OpenClawGeneric API routing
  • HermesGeneric API routing

Native config writing uses safe direct writes: a snapshot is taken before mutation, the write is atomic, concurrent changes are detected, and guarded rollback is supported.

See the full capability matrix →

Protocol bridging, no CLI reconfiguration

Each CLI keeps speaking its own protocol. AI Switch translates the request inside the local proxy to whatever the upstream account actually supports, so switching providers never means editing CLI config.

Local entry

Codex/responsesOpenAI Responses
Claude Code/v1/messagesAnthropic Messages
Gemini CLIGemini nativeGemini accounts only
AI Switch local proxy127.0.0.1:19527

Upstream protocol

openaiChat Completions
openai-responsesResponses API
anthropicMessages API
geminigenerateContent

Seven bridge routes

  • Responses → Chat Completions
  • Responses → Responses
  • Responses → Anthropic
  • Responses → Gemini
  • Claude → Chat Completions
  • Claude → Responses
  • Claude → Gemini
Learn about protocol routing →

One UI, four shapes

Desktop and browser share the same React UI and the same database, so proxy behaviour is identical either way.

  1. 01

    Desktop app

    A native Tauri 2 shell talking to the Rust core over IPC.

  2. 02

    LAN browser

    Start the web service with token auth and open it from a phone or tablet.

  3. 03

    Tailscale private

    Log in to Tailscale manually and reach it across your private network.

  4. 04

    Funnel public

    Enable Funnel when you need public reach — the token is still required.

Default bind is 127.0.0.1:3090; binding to 0.0.0.0 must be explicit. Every /api/* and /ws/events request needs the access token, Tailscale included.

See deployment options →

Architecture

One frontend, two transports, a shared core. The Rust core serves both desktop IPC and HTTP, so the two ends cannot drift apart.

UIReact 18 + TypeScript, one codebase for desktop and browser
Coreai_switch_lib — accounts, routing, sessions, terminal, MCP
TransportTauri IPC / axum HTTP + WebSocket
StorageSQLite across 23 migrations; data and credentials in the local data directory

Stack

  • Tauri 2
  • Rust
  • axum
  • sqlx
  • SQLite
  • React 18
  • TypeScript
  • Go sidecar
  • Tailscale tsnet
  • rustls
Read the architecture →

Get started with AI Switch

Install the desktop build and go, or run the service yourself for a team.

Released under the MIT License.