Use Aider with GammaInfra

Point Aider at GammaInfra's smart router and you get dollar-cost visibility per edit (not just token counts), the cost-quality dial for cheap-mode vs quality-mode per session, and automatic provider fallback when one provider rate-limits in the middle of a multi-file refactor. Setup is two env vars — Aider's existing CLI works unchanged.

The pain Aider users hit

Aider is precise — every edit is a diff, every diff is reviewable, every refactor goes through git. That precision has a cost shape Aider users know well:

What changes with GammaInfra

Point Aider at GammaInfra's smart router with two env-var changes — its existing CLI works unchanged on top of the OpenAI SDK shape. After the swap:

Setup

1. Get a GammaInfra API key

Sign up at gammainfra.com and verify your email. $3 trial credit covers maybe 30–50 Aider edits on a small repo, plenty to feel the difference.

2. Set environment variables

The cleanest way — put these in your shell rc file (.bashrc, .zshrc, etc.):

export OPENAI_API_BASE="https://api.gammainfra.com/v1"
export OPENAI_API_KEY="sk-gammainfra-..."

Aider reads these environment variables automatically — no flag needed.

3. Or pass them as CLI flags

aider --openai-api-base https://api.gammainfra.com/v1 \
      --openai-api-key sk-gammainfra-... \
      --model gammainfra/auto

4. Or put them in .aider.conf.yml

If you want repo-local config (or want different settings per repo):

# .aider.conf.yml (in your repo root)
openai-api-base: https://api.gammainfra.com/v1
openai-api-key: sk-gammainfra-...
model: gammainfra/auto

5. Pick a model

Aider benefits from quality models for harder edits. Some patterns:

Architect mode: Aider's --architect mode uses two models — one for planning, one for editing. Set --model anthropic/claude-opus-4-7 for the architect role and --editor-model openai/gpt-5-mini for the editor role. Opus plans cleanly, GPT-5-mini applies diffs cheaply. GammaInfra supports both via the same endpoint.

Cost-conscious patterns

Verify it's working

Start an aider session, make one edit, then in the dashboard:

Trade-offs

Troubleshoot

Ready to try it?

Get a GammaInfra API key →

$3 free trial credit on signup, $10 minimum top-up. Pass-through provider token rates plus 3% top-up fee during the launch window (5% after 2026-06-23).

Frequently asked questions

What's the aider command flag for GammaInfra?
Pass --openai-api-base https://api.gammainfra.com/v1 and --openai-api-key sk-gammainfra-... on the aider command line. Or set OPENAI_API_BASE and OPENAI_API_KEY environment variables. Then use --model gammainfra/auto or any specific model. aider remembers these in ~/.aider.conf.yml for the next session.
Can I see how much each aider edit cycle cost?
Yes. aider prints token counts and an estimated cost after each interaction. With GammaInfra, the actual billed cost may differ from aider's estimate because the router can dispatch to a different provider than aider thinks. The authoritative cost is in GammaInfra's dashboard and in the X-GammaInfra-Cost-USD response header.
Does aider's /architect mode work with smart routing?
Yes. /architect uses one model for the architect (planning) pass and another for the editor (diff) pass. Point the architect model at a quality tier (anthropic/claude-opus-4-7, or gammainfra/auto biased to quality via the X-GammaInfra-Cost-Quality header) and the editor model at a cheaper tier (anthropic/claude-sonnet-4-6 or gammainfra/cheap). aider exposes separate settings for the two passes — see aider's current docs for the exact option names; each pass routes independently through GammaInfra.
What model should I pin for code-heavy aider sessions?
anthropic/claude-sonnet-4-6 is the practical sweet spot — best real-world code quality, reasonable cost. claude-opus-4-7 for hard problems where you want max quality. For straightforward edits in well-organized repos, gpt-5-mini or deepseek-v4-flash via gammainfra/cheap can produce equivalent results at a fraction of the cost.
Does GammaInfra support aider's /web command?
aider's /web command fetches a URL locally and adds the page content to the chat context. That's an aider-side feature — it doesn't touch the LLM call. After the page content is in the chat, the next message routes through GammaInfra normally. So yes, /web works, GammaInfra just doesn't see the fetch step.