Configure Aider to use GitHub Copilot's API with Claude Sonnet 4 as the main model and GPT-4o-mini as the weak model for cost-effective AI pair programming.
Configure Aider to use GitHub Copilot's API endpoint with Claude Sonnet 4 as your primary model and GPT-4o-mini as the weak model for optimal performance and cost efficiency.
This configuration sets up Aider to route requests through GitHub Copilot's API, allowing you to use Claude Sonnet 4 for complex reasoning tasks while falling back to the faster, cheaper GPT-4o-mini for simpler operations like linting and syntax checks.
1. **Set your GitHub Copilot API key as an environment variable**:
```bash
export OPENAI_API_KEY="your_github_copilot_api_key"
```
Or add it to your shell profile (~/.bashrc, ~/.zshrc, etc.)
2. **Create an Aider configuration file** at `~/.aider.conf.yml`:
```yaml
openai-api-base: https://api.githubcopilot.com
model: openai/claude-sonnet-4
weak-model: openai/gpt-4o-mini
show-model-warnings: false
dark-mode: true
watch-files: true
```
3. **Verify the configuration** by running:
```bash
aider --check
```
4. **Start using Aider** with your configured models:
```bash
aider <files>
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/github-copilot-api-with-aider/raw