Skip to content
Claude Code logo (Anthropic)

Claude Code via Tokonomix

Route Anthropic's agentic coding tool through one Tokonomix key — reach 132 models across families, and add cross-family consensus to high-stakes changes.

ANTHROPIC_BASE_URL + MCPTerminal + IDE agentVS Code · JetBrains · Desktop · WebAnthropic · subscription / API key
Claude Code by Anthropic — official product banner

What is Claude Code?

Claude Code is Anthropic's agentic coding tool: it reads your codebase, edits files across many directories, runs commands, and opens pull requests. Unlike most CLI agents it spans surfaces that share one engine — a Terminal CLI, a VS Code extension (inline diffs, @-mentions, plan review), a JetBrains plugin, a Desktop app, and the web at claude.ai/code. Your CLAUDE.md files, settings and MCP servers carry across all of them.

Most surfaces use a Claude subscription or Anthropic Console account — but the Terminal CLI and VS Code also support third-party providers. That hook is where Tokonomix plugs in: set the Tokonomix base URL plus your API key and Claude Code’s calls route through a single key with access to 132 models from Anthropic, OpenAI, Google, Mistral, Meta and others.

As an agent, Claude Code does real work rather than just suggesting completions: it plans a change, edits across multiple files, runs your tests, fixes what breaks, and stages a commit or opens a pull request. It can spawn sub-agents for parallel workstreams, run shell hooks before and after edits (auto-format, lint-on-commit), and read project rules you keep in a CLAUDE.md file at the repo root. Because the same engine drives every surface, a workflow you set up in the terminal behaves identically inside VS Code or a JetBrains IDE — and so does the Tokonomix integration described below.

Why route Claude Code through Tokonomix?

Claude Code is excellent at Anthropic’s own models, but a single model — however good — has blind spots, and not every task wants the same engine. Routing through Tokonomix gives you a model layer that is broader (every major family behind one key), safer on the decisions that matter (a consensus verdict instead of one opinion), and fully accountable (per-call cost and region control). You keep Claude Code’s agentic workflow; Tokonomix changes only what sits behind the API call.

  • Cross-family consensus on demand. Add the Tokonomix MCP server and Claude Code can call tokonomix_consensus_ask on any high-stakes refactor or design decision — 2–6 frontier models cross-checked by a judge, so a confident-but-wrong step gets caught before it lands in your repo.
  • One key, 132 models. Reach non-Anthropic models through the same key without separate accounts.
  • Sovereignty routing — your choice, not EU-only. Pin models by where they run (hosting_region) or where they're made (origin_country) — EU-only, US-only, a single country, or a custom set. Enforce it per call, or set a predefined rule (e.g. auto-select EU models) in your dashboard. EU/GDPR is just one example.
  • Transparent per-call cost. Every call is metered to the cent in your Tokonomix dashboard, so an agent that fires hundreds of calls a day never surprises you.
  • Provenance & sovereignty. Filter by origin_country to pick models by where they were built — not just where they run — when procurement or sovereignty rules demand it.

Install Claude Code — Windows, macOS, Linux (also WSL)

Native installers auto-update in the background. Git for Windows is recommended on native Windows so Claude Code can use its Bash tool.

⊞ Windows
PowerShell
irm https://claude.ai/install.ps1 | iex
macOS
Terminal · or Homebrew
curl -fsSL https://claude.ai/install.sh | bash
# or
brew install --cask claude-code
🐧 Linux
also WSL
curl -fsSL https://claude.ai/install.sh | bash

Then start it in any project:

cd your-project
claude

Enter your Tokonomix key

No key yet?

Create a free account at tokonomix.ai/dashboard/signup — it includes a free starter balance — then generate a key (tok_live_…) and wire it in below.

Already have a key? Claude Code reads a third-party gateway from two environment variables. Generate a key (tok_live_…) in your Tokonomix dashboard and point Claude Code at the Anthropic-compatible endpoint:

# route Claude Code through Tokonomix
export ANTHROPIC_BASE_URL=https://tokonomix.ai/api/anthropic
export ANTHROPIC_API_KEY=tok_live_your-key
claude
Header note

Tokonomix’s /api/anthropic accepts both the x-api-key header (ANTHROPIC_API_KEY) and Authorization: Bearer (ANTHROPIC_AUTH_TOKEN) — either variable works. Put the export lines in your shell profile (or a project .env), not in version control.

Pull in skills & MCP tools

Two complementary layers — base-URL passthrough for everyday model access, and MCP for consensus on demand.

Route A — passthrough (everyday)

With the env vars above, Claude Code's normal operation runs through Tokonomix's models. Nothing else to configure.

# already wired by ANTHROPIC_BASE_URL
claude "refactor the auth module"

Route B — consensus via MCP

Register the Tokonomix MCP server so Claude Code can call consensus as a tool on high-stakes steps.

claude mcp add tokonomix -- \
  npx -y tokonomix-mcp
# set the key for the server
TOKONOMIX_API_KEY=tok_live_your-key
Or just ask — no manual config

Because Claude Code is an agent with shell access, you don’t have to run the command yourself. In a session, just type: "Add the Tokonomix MCP server — npx -y tokonomix-mcp — using my TOKONOMIX_API_KEY." Claude Code runs claude mcp add and reloads its tools for you. Same trick works in any agentic client that can edit its own MCP config (Cline, Goose, and others).

The Tokonomix MCP server exposes tokonomix_consensus_ask, tokonomix_single_ask, tokonomix_list_models and tokonomix_get_skill. Claude Code will call consensus when a task is high-stakes; you can also nudge it explicitly ("get a consensus verdict on this migration"). The two routes compose well: keep base-URL passthrough for the fast, high-volume edits Claude Code makes all day, and let it reach for the consensus tool only at the moments where being wrong is expensive — a schema migration, an auth change, a public API contract. Browse Claude Code’s own skills with /skills, package repeatable workflows as custom skills your team shares, and keep coding standards and architecture notes in CLAUDE.md so every session — on any surface — starts with the same context.

Using Claude Code inside an IDE

Here Claude Code differs from terminal-only agents: it ships native editor extensions, so the agent lives inside your IDE with inline diffs — not just in a terminal pane. The Tokonomix env vars and MCP server apply identically across every surface, because they all share one engine.

EnvironmentHow Claude Code works thereInline edits?
VS CodeNative extension anthropic.claude-code — inline diffs, @-mentions, plan reviewNative extension
CursorSame extension installs in CursorNative extension
JetBrainsPlugin for IntelliJ / PyCharm / WebStorm — diff viewer + selection contextNative plugin
Antigravity / otherRun claude in the integrated terminal; edits land in the workspaceVia terminal
Desktop / WebStandalone app + claude.ai/code — visual diff review, parallel sessionsYes

Verify it works

After exporting the env vars, run claude and ask for a small reversible change — say, add a docstring. You should see a metered call in your Tokonomix dashboard. Then add the MCP server and ask Claude Code to "get a consensus verdict" on a risky change; the multi-model result comes back as the MCP tool result.

In short

Two env vars (base URL + key) route Claude Code through Tokonomix’s 132 models; the MCP server adds cross-family consensus as a tool. Both work the same in the terminal, VS Code, JetBrains, desktop and web.

Model selection

Which model and endpoint should my agent use?

Pick by what your agent does, then swap the model id any time — every model in the catalog works through the same key.

What your agent doesUse this
Edits files / calls tools and streams responses (most coding agents)An Anthropic model via the Anthropic endpoint (tools + streaming both work)
Calls tools but does not need streaming (any model)The OpenAI-compatible endpoint with a single model id
Wants tools and streaming on a non-Anthropic modelRun non-streaming for now — streaming tool-calls on other providers is not enabled yet
Plain chat, no toolsEither endpoint; streaming is fine
Wants a cross-model verdict (consensus) on a high-stakes answerSet model to tokonomix-consensus on the OpenAI-compatible endpoint — note: consensus rejects tool requests (no tool-calling)
Endpoint & API reference (technical)

anthropic-messages → https://tokonomix.ai/api/anthropic — tools ✓, streaming ✓ (use an Anthropic model). openai-completions → https://tokonomix.ai/api/v1 — tools ✓ (single-model passthrough), streaming with tools not yet enabled. Plain chat: streaming works on both. Consensus: openai-completions, model tokonomix-consensus, no tools. Swap the model id to any slug returned by GET /api/v1/models.

Browse all models →

Related agents