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_askon 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_countryto 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.
irm https://claude.ai/install.ps1 | iexcurl -fsSL https://claude.ai/install.sh | bash
# or
brew install --cask claude-codecurl -fsSL https://claude.ai/install.sh | bashThen start it in any project:
cd your-project
claudeEnter your Tokonomix key
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
claudeTokonomix’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-keyBecause 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.
| Environment | How Claude Code works there | Inline edits? |
|---|---|---|
| VS Code | Native extension anthropic.claude-code — inline diffs, @-mentions, plan review | Native extension |
| Cursor | Same extension installs in Cursor | Native extension |
| JetBrains | Plugin for IntelliJ / PyCharm / WebStorm — diff viewer + selection context | Native plugin |
| Antigravity / other | Run claude in the integrated terminal; edits land in the workspace | Via terminal |
| Desktop / Web | Standalone app + claude.ai/code — visual diff review, parallel sessions | Yes |
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.
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.
