
Aider
AI pair programming in your terminal with git-native commits
Connect with the TokenMix CLI
The official TokenMix CLI sets this up in one command — no manual environment variables:
npx tokenmix aider
It signs you in and points Aider at TokenMix for you. Prefer to configure it by hand? The full steps are below.
Introduction
Aider turns your terminal into an AI pair programmer. You describe what you want, and Aider edits the relevant files in your codebase — then automatically commits the changes to Git with a descriptive message. This git-first approach means you can always see what the AI did, diff it, or revert it. By pointing Aider at TokenMix, you can use top models like claude-opus-4.8 and deepseek-v4-pro.
Prerequisites
- Python 3.9 or later — run
python3 --versionto confirm - Git installed and a git repository to work in
- A TokenMix account with an API key starting with
sk-tm-→ Register at tokenmix.ai → Dashboard → API Keys
Setup Steps
1. Install Aider
pip install aider-chat
Verify:
aider --version
2. Set environment variables
Aider uses OPENAI_API_BASE and OPENAI_API_KEY for OpenAI-compatible endpoints. Add them to your shell profile (~/.zshrc or ~/.bashrc):
export OPENAI_API_BASE="https://api.tokenmix.ai/v1"
export OPENAI_API_KEY="sk-tm-your-key-here"
Reload your shell:
source ~/.zshrc
3. Launch Aider with a TokenMix model
Navigate to your git repository and start Aider, prefixing the model name with openai/:
cd ~/your-project
aider --model openai/claude-opus-4.8
For DeepSeek:
aider --model openai/deepseek-v4-pro
4. Give Aider a task
At the Aider prompt, describe what you want:
Add input validation to the register endpoint — email format check and minimum password length of 8 characters.
Aider edits the files, shows a diff, and asks for confirmation before committing.
Verify
After Aider makes a change, run:
git log --oneline -3
You should see a new commit authored by Aider with a descriptive message. The change is fully tracked and reversible with git revert.
FAQ
Q: Why prefix the model with openai/?
The openai/ prefix tells Aider to use the OpenAI-compatible API format (routing through OPENAI_API_BASE). Without it, Aider would try native Anthropic or OpenAI SDKs with the wrong endpoint.
Q: Can I use Aider without committing every change?
Yes. Pass --no-auto-commits to disable automatic commits. Aider will still edit files; you commit manually when you're satisfied.
Q: How do I switch models mid-session?
Type /model openai/deepseek-v4-pro at the Aider prompt to switch models without restarting.