All docs

Aider with 6bee.ai

Aider connects to any OpenAI-compatible API. Set two environment variables and pass the model with an openai/ prefix.

Before you start

  • Aider installed (python -m pip install aider-install && aider-install).
  • Create an account with a verified email address, add prepaid balance, then create a key on the console's API keys page. Keep the key secret.
  • Model IDs are listed in the console and returned by GET https://api.6bee.ai/v1/models. Replace <model id> with one of them.

Set the variables and start

shell
export OPENAI_API_BASE=https://api.6bee.ai/v1
export OPENAI_API_KEY=<your key>

aider --model openai/<model id>
OPENAI_API_BASE
https://api.6bee.ai/v1, with /v1.
OPENAI_API_KEY
Your 6bee.ai key.
openai/ prefix
Tells Aider to use the OpenAI-compatible route. It is not part of the model ID and is not sent to the API.

Make it permanent

Put the settings in .aider.conf.yml in your home folder or in the repository:

.aider.conf.yml
openai-api-base: https://api.6bee.ai/v1
model: openai/<model id>

Keep the key in the OPENAI_API_KEY environment variable, so it does not end up in a committed file.

Good to know

  • Aider may warn that it does not know the context window or cost of the model. The warning is harmless. The real cost is in the console’s usage log.
  • Aider sends the files you add to the chat on every turn. Use /drop to remove files you no longer need, so requests keep fitting the context window.
Context
Input plus output up to the model’s window: 128K to 1M tokens, depending on the model.
Output
max_tokens up to the model’s output cap: 16,384 to 131,072, depending on the model. Larger values are lowered to the cap, not rejected. If omitted: 8,192 to 32,768.

Troubleshooting

HTTP 401
The key is missing or wrong. Copy it again from the console, without spaces or quotes.
Model not found
The model ID does not match. List the valid IDs with GET /v1/models or check the console.
HTTP 429
You are over a per-account limit (requests, input tokens or concurrency). The Retry-After header says how long to wait.
HTTP 400 on long sessions
The request no longer fits the model’s context window. Compact or clear the conversation, or switch to a model with a larger window.
Request rejected for balance
Each request first reserves its input plus max_tokens of output. Top up, or lower max_tokens.
Aider asks for an OpenAI key or calls api.openai.com
Check that OPENAI_API_BASE is exported in the same shell and that the model starts with openai/.