Skip to Content

Aider (gateway)

Route Aider ’s LLM calls through the Respan gateway for automatic logging, caching, and model switching. Aider supports OpenAI-compatible endpoints, so only your RESPAN_API_KEY is needed.

Paste this into your coding agent:

Help me set up the Respan gateway with the Aider integration. Follow https://www.respan.ai/docs/integrations/gateway/aider.md

Setup

Install Aider

Terminal
python -m pip install aider-install && aider-install

Set environment variables

Add to your shell profile (.bashrc, .zshrc, or PowerShell $PROFILE):

Terminal
export OPENAI_API_BASE="https://gateway.respan.ai" export OPENAI_API_KEY="YOUR_RESPAN_API_KEY"

No separate OpenAI API key needed. The Respan gateway handles provider authentication.

Run Aider

Prefix the model with openai/ so Aider uses the OpenAI-compatible route:

Terminal
aider --model openai/gpt-4o

All LLM calls now route through Respan.

Switch models

Change the --model flag to use any of the 1000+ models available through the gateway. Keep the openai/ prefix so calls go through the OpenAI-compatible endpoint.

Terminal
aider --model openai/gpt-4o aider --model openai/claude-sonnet-4-5-20250929 aider --model openai/gemini/gemini-3.5-flash

See the full model list .