Docs

Aider

Aider reads OPENAI_API_BASE and OPENAI_API_KEY. Point them at Kunavo, prefix the model id with openai/, and Claude, GPT and Gemini are all one --model argument apart.

Two environment variables and a prefix. Set OPENAI_API_BASE to https://api.kunavo.com/v1, OPENAI_API_KEY to your sk-kn-… key, then run Aider with --model openai/<id>. Nothing about the repo or the Aider install changes.

~/.zshrc
export OPENAI_API_BASE=https://api.kunavo.com/v1
export OPENAI_API_KEY=sk-kn-...

# The openai/ prefix is required — it tells Aider to speak the OpenAI
# protocol to OPENAI_API_BASE instead of resolving the id as a known model.
aider --model openai/claude-sonnet-4-6
The openai/ prefix is required and the /v1 suffix belongs in the base URL. Dropping the prefix makes Aider resolve the id against its own provider table — the “unknown model” error — and dropping /v1 makes the request miss the route entirely.

Step by step

  1. Create a key at /app/keys and copy it — it is shown once.
  2. Export OPENAI_API_BASE and OPENAI_API_KEY in the shell you start Aider from, or put them in ~/.aider.conf.yml as shown below.
  3. Start Aider in your repo with aider --model openai/claude-sonnet-4-6.
  4. Aider prints the model it resolved on startup. If that line shows the id you asked for, the endpoint is wired.

Aider's own reference for this is the OpenAI-compatible APIs page.

Keeping it out of your shell profile

The same two values live in Aider's config file, which is the better home when you switch between endpoints per project.

~/.aider.conf.yml
# ~/.aider.conf.yml — same two values, without exporting them each shell.
openai-api-base: https://api.kunavo.com/v1
openai-api-key: sk-kn-...
model: openai/claude-sonnet-4-6

Verify before you debug Aider

One request settles whether a failure is the endpoint, the key, or Aider's model resolution. If this returns a JSON list of model ids, the same base URL and key work in Aider — and any remaining error is the openai/ prefix.

# Settles whether a failure is the endpoint, the key, or Aider.
# A JSON list of model ids means the same base URL will work in Aider.
curl -sS https://api.kunavo.com/v1/models \
  -H "Authorization: Bearer sk-kn-..."

Which models to pick

Every text model on Kunavo is reachable as openai/<id> — the full list is on the models page and comes back live from GET /v1/models. Rates are USD per 1M tokens, input / output.

Model idKunavo in / outWhere it fits
claude-haiku-4-5$0.40 / $2.00Cheapest Claude — good for Aider's repo-map and commit-message calls
claude-sonnet-4-6$1.20 / $6.00The default balance of quality and price for editing
claude-opus-5$2.00 / $10.00Highest-quality Claude tier — architecture-level changes
gpt-5-4$1.00 / $6.00Same key, different family — useful as a second opinion on a hard diff
Aider re-sends the repo map and the edited files on every exchange, so token spend tracks the size of the context rather than the size of the edit. That makes prompt caching the lever that matters most here, and --model plus --weak-model openai/claude-haiku-4-5 the cheapest split: the strong model edits, the weak one writes commit messages and summaries. Billing is per token from a prepaid balance with no monthly fee — details in billing.

FAQ

How do I use Aider with an OpenAI-compatible API?

Set OPENAI_API_BASE to the endpoint's base URL and OPENAI_API_KEY to your key, then start Aider with the model id prefixed by openai/ — for example `aider --model openai/claude-sonnet-4-6`. For Kunavo the base URL is https://api.kunavo.com/v1. The prefix is not optional: without it Aider tries to resolve the id against its own provider table instead of sending it to your endpoint.

Can Aider use Claude models through an OpenAI-compatible endpoint?

Yes. Aider talks to whatever OPENAI_API_BASE points at using the OpenAI protocol, so a Claude model served in that format is reachable without Anthropic credentials — the model id is just another string in the /v1/models list. On Kunavo the Claude, GPT and Gemini ids all sit behind the same key, so switching between them is a different --model argument rather than a different configuration.

Why does Aider say the model is unknown?

Almost always the missing openai/ prefix. Aider treats a bare id as a model it should recognise and fails when it does not; `openai/<id>` tells it to pass the id straight through to OPENAI_API_BASE. The second most common cause is a base URL without the /v1 suffix, which produces a connection or 404 error rather than an unknown-model one.

Does Aider show what a session cost?

Aider prints token counts and an estimated cost per exchange, derived from its own model metadata — for a custom endpoint that estimate can be wrong, because Aider does not know your endpoint's rates. Treat the token counts as the reliable half and read the actual charge from your provider. On Kunavo the per-request cost is in the usage view, billed from a prepaid balance with no monthly fee.