Skip to content
Aider logo (terminal wordmark)

Aider via Tokonomix

Seamlessly power Aider's terminal pair-programming with 130+ models and on-demand consensus reasoning — all via one Tokonomix key.

OpenAI-compatible base URLTerminal pair-programmerApache-2.0 · open sourcemacOS · Windows · Linux
Aider — open-source AI pair programming in your terminal

What is Aider?

Aider is an open-source AI pair-programming agent that runs in your terminal and operates directly inside your git repo. It maps your project, generates code diffs, applies the changes to your files and auto-commits each one with an AI-written message — all through an OpenAI-compatible API endpoint.

  • Performs inline or diff-based file edits and commits changes with AI-generated messages.
  • Maps your whole repository to give the model context on all relevant files, not just the ones you name.
  • Accepts structured in-chat commands like /add, /architect, /undo and /run (to feed test output back to the model).
  • Talks to any OpenAI-compatible endpoint via OPENAI_API_BASE + OPENAI_API_KEY; swap models per turn with --model openai/<slug>.

Why route Aider through Tokonomix?

Aider's workflow bounces between fast, repetitive line edits and critical architectural decisions. Tokonomix makes both efficient: switch models per task with a single key — no separate provider setups — and add a verification step exactly where being wrong is expensive.

  • Switch instantly between fast direct models (for frequent line edits) and the multi-model tokonomix-consensus for large refactors or risky architecture changes.
  • Single-key access to 130+ models from Anthropic, OpenAI, Google, Meta, Mistral and more — all behind one OpenAI-compatible endpoint.
  • Control cost precisely with per-call spend caps, so a runaway loop or oversized context can’t bust your budget.
  • Enable EU / sovereignty routing to keep proprietary repo data compliant — vital, since Aider streams real source code in every API call.

Connect Aider to Tokonomix

Aider works out of the box with Tokonomix — supply the base URL and your tok- key, then pick the right model slug for the task. Install Aider itself with python -m pip install aider-install && aider-install (or pipx install aider-chat).

  • Generate (or copy) your tok- API key from the Tokonomix dashboard.
  • Set OPENAI_API_BASE to https://tokonomix.ai/api/v1.
  • Set OPENAI_API_KEY to your Tokonomix key.
  • Launch Aider with --model openai/tokonomix-consensus for design/refactor turns, or a direct slug like openai/anthropic/claude-sonnet-4-6 for rapid edits.
export OPENAI_API_BASE="https://tokonomix.ai/api/v1"
export OPENAI_API_KEY="tok-..."

# Fast, high-volume edits (cheap, direct model)
aider --model openai/anthropic/claude-sonnet-4-6

# Major refactors, /architect turns, or risky changes (multi-model + judge)
aider --model openai/tokonomix-consensus
No key yet?

Create a free account at tokonomix.ai/dashboard/signup — it includes a free starter balance — then paste the key into your shell as OPENAI_API_KEY.

Consensus vs direct: when to use which

Aider's efficiency comes from matching model choice to task risk. Use direct models for routine code edits; reserve tokonomix-consensus for structural or high-stakes decisions, where a second and third opinion pays for itself.

Aider taskRecommended modelWhy
Fix typos, rename functions, update a few linesopenai/anthropic/claude-sonnet-4-6High-frequency; one fast model is accurate enough at minimal cost and latency.
Implement features in existing modulesopenai/anthropic/claude-sonnet-4-6Quick edit/commit turns thrive on low overhead — ideal for fast feedback on small-scope changes.
Large-scale refactor, migration or cross-file redesignopenai/tokonomix-consensusMulti-model output plus an independent judge lowers the risk of single-model oversights in codebase-wide changes.
Scaffolding new architecture or critical design reasoningopenai/tokonomix-consensusSeveral LLM perspectives keep the design consistent and surface subtle, costly mistakes early.
When to use consensus

The tokonomix-consensus model runs several top-tier LLMs in parallel and uses a judge to resolve disagreements, so its latency is much higher than a direct model. For Aider's normal rapid edit/commit loop, stick with a direct model; switch to consensus only for /architect, whole-repo refactors, or other crucial design turns.

Verify it works

Test the integration with a one-line edit to confirm Tokonomix routing and model response.

  • Run Aider in a scratch or demo repo with a direct model and make a simple file edit.
  • Check Aider applies the edit, prints the diff, and creates a git commit.
  • Open your Tokonomix dashboard and confirm the request and token usage are logged.
aider --model openai/anthropic/claude-sonnet-4-6 --message "insert a # Hello World comment at the top of main.py"
# Success: Aider prints a diff, applies the change, and logs the call on your Tokonomix dashboard.

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