Aider
Use Foza models with Aider AI pair programming
Setup#
Connect Aider to the Foza gateway using environment variables.
Aider expects OpenAI-compatible model names to be prefixed with openai/ on the command line. Because Foza model slugs already include a provider prefix, the full Aider model string often looks like openai/anthropic/claude-sonnet-4.6.
Get your API key
Create an API key at Console → API Keys and subscribe it to a model.
Set environment variables
export OPENAI_API_BASE=https://api.foza.ai/v1 export OPENAI_API_KEY=sk-foza-xxxxx
Add these to your ~/.bashrc or ~/.zshrc to persist them.
Run Aider
aider --model openai/anthropic/claude-sonnet-4.6Or for OpenAI models:
aider --model openai/openai/gpt-4oStart with a narrow request
aider --model openai/anthropic/claude-sonnet-4.6 README.mdThen ask Aider to make a small documentation change before letting it edit source files.
Persistent project config#
Create .aider.conf.yml in your project root:
openai-api-base: https://api.foza.ai/v1 openai-api-key: sk-foza-xxxxx model: openai/anthropic/claude-sonnet-4.6
You can also keep the key in OPENAI_API_KEY and omit openai-api-key from the file.
Troubleshooting#
| Symptom | What to check |
|---|---|
| Aider warns about unknown model | The model can still work; confirm the Foza slug is correct |
| Auth failure | OPENAI_API_KEY is set in the shell running Aider |
| Wrong endpoint | OPENAI_API_BASE should be https://api.foza.ai/v1 |
| Model string confusion | Use openai/<foza-model-slug> |
Run Aider on a small set of files first, for example aider src/app/page.tsx, so the model has focused context and produces smaller diffs.