Skip to Content
cc-switch (recommended)Configure AllTokens

Configure AllTokens

Get a key first

cc-switch only writes configuration into your tools — the key comes from us. If you do not have one, see Keys and authentication:

  • Personal keys are created in the console under API keys (/keys);
  • Enterprise shared keys are created and handed out by an administrator under Shared API keys.

Two Base URLs — pick by the tool’s protocol

This is the one place people get it wrong:

The tool speaksBase URL
OpenAI-compatiblehttps://alltokens.si/v1
Anthropic-compatiblehttps://alltokens.si (no /v1)

Anthropic-protocol tools append /v1/messages themselves, so you give them just the site address. Getting this wrong shows up as “path not found” rather than an authentication error.

Both paths are real on our side:

POST https://alltokens.si/v1/chat/completions # OpenAI-compatible POST https://alltokens.si/v1/messages # Anthropic-compatible GET https://alltokens.si/v1/models # model list

What to fill in per tool

ToolProtocolBase URL
Claude CodeAnthropichttps://alltokens.si
Claude DesktopAnthropic (third-party provider)https://alltokens.si
CodexOpenAI-compatiblehttps://alltokens.si/v1
OpenCode / OpenClaw / Hermes / Pi / MiniMax CodeOpenAI-compatiblehttps://alltokens.si/v1

Tools such as Gemini CLI and Grok Build speak their own native protocols, neither OpenAI nor Anthropic format. cc-switch’s local routing can convert between formats. For those, follow cc-switch’s presets and field hints — they tell you which format that tool expects. We have not tested that path per tool, so we will not guess for you here.

Add the provider

  1. Open cc-switch and select the tool in the sidebar (say Claude Code or Codex).
  2. Click Add provider:
    • Name: AllTokens (anything recognisable)
    • Base URL: from the table above
    • API key: paste your sk-...
    • You can start from a custom entry or from a preset.
  3. Save, select the provider, then click Enable.
  4. Restart that terminal or CLI tool so the configuration takes effect. Claude Code supports hot switching without a restart; most others need one.

On first launch cc-switch can import your existing CLI configuration as the default provider, so you do not have to clear anything out first.

Day-to-day switching

  • Main window: pick a provider → Enable.
  • System tray: click the provider name — effective immediately (the usual route).
  • Back to official: add the official login preset → Enable → log out and back in inside that tool.

Connection modes: direct, routing, aggregation

  • Direct: the client talks to the provider itself; requests bypass cc-switch.
  • Routing: requests are forwarded through the local cc-switch. This is what enables automatic failover and the circuit breaker — a failing primary switches to a backup, and a repeatedly failing provider is cut off instead of retried forever.
  • Aggregation: Claude Code and Codex only — models from several providers appear in one /model list.

Local routing also converts between Anthropic Messages, OpenAI Chat Completions, OpenAI Responses and Gemini Native.

Decide before you queue up providers: routing adds a local hop. You need it for failover; you do not need it just to switch configurations. Also note that usage recorded under routing is cc-switch’s own tally — a different basis from our console. Reconcile against Usage.

Confirming it works

  1. Send a request from the tool; a normal response means the configuration is live;
  2. Check Usage or Request logs in our console — the call should be there;
  3. cc-switch shows its own usage and balance — if the balance matches, you are on the key you think you are.

Model names are whatever the platform currently serves. In every tool, replace the example model with a name that actually works today — check models and pricing . On “model not found”, check that before suspecting the key.

Troubleshooting

Switching did not take effect — restart the terminal or CLI tool. Everything except Claude Code generally needs it.

Plugins/MCP/other config disappeared after switching — use cc-switch’s Unified provider or Shared Config Snippet to carry shared configuration across, so a switch does not reset your setup.

I want AllTokens and an official account at the same time — for “coexist” tools (OpenCode, OpenClaw, Hermes, Pi, MiniMax Code) several providers are written into the tool at once and you pick inside the tool; for “switch” tools only one is active at a time.

A key leaked — disable or delete that key in our console first (see Keys and authentication), then swap in the new one in cc-switch. The key does not live in cc-switch; revoking it on our side is what actually stops it.

Where is the configuration? — ~/.cc-switch/ (SQLite database plus automatic backups). The backups protect against mistakes, but do not copy backups full of keys around.