Configure Aider to use OpenRouter's free tier models (Qwen 2.5 Coder) with auto-commits and project-specific file handling. Preserves premium API usage while maintaining full coding assistant capabilities.
Configures Aider to use OpenRouter's free tier models instead of premium APIs, preserving your Claude or other paid API credits while maintaining full coding assistant functionality.
Sets up an `.aider.conf.yaml` configuration that routes Aider through OpenRouter using Qwen 2.5 Coder 32B Instruct (free tier) as the primary model, with fallback options for other free models. Includes sensible defaults for auto-commits, file handling, and development workflow.
1. **Check for existing configuration**
- Look for `.aider.conf.yaml` or `.aider.yml` in the project root
- If found, ask user whether to overwrite or merge settings
2. **Verify OpenRouter API key**
- Check if `OPENROUTER_API_KEY` environment variable is set
- If not set, instruct user to:
- Sign up at https://openrouter.ai
- Get free API key from dashboard
- Set environment variable: `export OPENROUTER_API_KEY=your_key_here`
- Confirm key is available before proceeding
3. **Create configuration file**
- Create `.aider.conf.yaml` in project root with:
- OpenRouter API endpoint (`https://openrouter.ai/api/v1`)
- Primary model: `openrouter/qwen/qwen-2.5-coder-32b-instruct`
- Fallback models list in comments for easy switching
- Auto-commits enabled, dirty commits disabled
- Git integration enabled
- Pretty printing and streaming enabled
- Show diffs for review
4. **Configure file handling**
- Set include patterns based on project type:
- Python projects: `**/*.py`, `*.md`, `*.yml`, `*.yaml`
- JavaScript/TypeScript: `**/*.js`, `**/*.ts`, `**/*.jsx`, `**/*.tsx`, `*.md`, `*.json`
- Full-stack: Combine relevant patterns
- Add standard exclude patterns:
- `__pycache__/`, `*.pyc` (Python)
- `node_modules/`, `.git/`
- `venv/`, `.venv/`, `.env`
- Build directories: `dist/`, `build/`, `.next/`
5. **Set editor preference**
- Default to `code` (VS Code)
- If user has different preference (vim, emacs, nano), update `editor` field
- Set `dark_mode: auto` for terminal theme detection
6. **Add usage instructions**
- Create or update README section with:
- How to verify configuration is working
- Command to test: `aider --model openrouter/qwen/qwen-2.5-coder-32b-instruct --test`
- How to switch to fallback models if primary is rate-limited
- Link to OpenRouter free tier limits and model documentation
7. **Validate configuration**
- Ensure YAML syntax is valid
- Verify all paths in include/exclude patterns exist or are relevant
- Check that environment variable interpolation syntax is correct for the shell
```yaml
model: openrouter/qwen/qwen-2.5-coder-32b-instruct
api_base: https://openrouter.ai/api/v1
openrouter_api_key: ${OPENROUTER_API_KEY}
auto_commits: true
dirty_commits: false
git: true
stream: true
pretty: true
show_diffs: true
editor: code
dark_mode: auto
include:
- "**/*.py"
- "*.md"
exclude:
- "__pycache__/"
- ".git/"
- "node_modules/"
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/openrouter-free-tier-setup-for-aider/raw