Skip to content
Try chatGet API key

Aider

Aider is an open-source pair-programming tool for the terminal that edits files in your git repository. It talks to any OpenAI-compatible API.

Copies this page's setup instructions, to paste into your coding agent.
Show the prompt
Help me set this up to use Bayle AI, an OpenAI-compatible API. Full guide: https://docs.bayle.ai/guides/coding-tools/aider/

Goal: set up Aider (https://aider.chat) to pair-program with a Bayle model.

1. Install Aider if `aider --version` fails:
   python -m pip install aider-install
   aider-install
2. Configure it. Export these in my shell profile or the current shell (the key stays in the environment):
   export OPENAI_API_BASE="https://api.bayle.ai"
   export OPENAI_API_KEY="$BAYLE_API_KEY"
   To keep the non-secret settings, create .aider.conf.yml in my repository or home directory:
   openai-api-base: https://api.bayle.ai
   model: openai/MODEL_ID
   The `openai/` prefix only tells Aider to use its OpenAI-compatible client; Bayle never receives it.
3. Pick a model suited to code:
   curl -s "https://api.bayle.ai/models?type=text" \
     | jq -r '.data[] | select(.model_spec.capabilities.optimizedForCode) | .id'
   Show me the list, let me choose, and use that id as MODEL_ID.
4. Verify with a short non-interactive run on the chosen model:
   aider --model openai/MODEL_ID --message "Reply with the word ready and change nothing." --no-git --yes-always
   Aider warns that it does not know the model's context size or price. That is expected.

Rules:
1. The base URL is https://api.bayle.ai exactly as written. Append no path to it.
2. Read the key from the BAYLE_API_KEY environment variable. Never write the key itself into a file you create, a command, a commit or the chat. Where the tool keeps the key in its own settings screen, tell me where to paste it. If BAYLE_API_KEY is not set, stop and ask me to create a key at https://chat.bayle.ai/developers and export it.
3. Take model ids only from GET https://api.bayle.ai/models (no key needed). Never guess one.
4. Finish with one real test request, show me the result and list the files you changed.
Terminal window
python -m pip install aider-install
aider-install

This installs Aider in its own Python environment. See the official install guide for other methods.

Don't have a Bayle key yet?Get API key

Point Aider’s OpenAI settings at Bayle and prefix the model id with openai/:

Terminal window
export OPENAI_API_BASE="https://api.bayle.ai"
export OPENAI_API_KEY="$BAYLE_API_KEY"
aider --model openai/MODEL_ID
  • The openai/ prefix tells Aider to use the OpenAI-compatible client; it is not part of the id Bayle receives.

To keep it, put the non-secret settings in .aider.conf.yml in your repository or home directory, and leave the key in the environment:

openai-api-base: https://api.bayle.ai
model: openai/MODEL_ID
Terminal window
curl -s "https://api.bayle.ai/models?type=text" \
| jq -r '.data[] | select(.model_spec.capabilities.optimizedForCode) | .id'

Aider will warn that it doesn’t know the model’s context size or price. That’s expected for a model it has no built-in entry for, and it still works.