· rangkumin.tech

Aider With an OpenAI-Compatible API: AtmoRouter Setup Guide

Aider works with any OpenAI-compatible endpoint, but for models it doesn't recognise it reports zero cost and an unlimited context window. This AtmoRouter-authored guide covers the metadata file that fixes the cost readout and the three-model split for architect, editor and weak calls.

Why it matters

Aider reads OPENAI_API_BASE and OPENAI_API_KEY, and prefixes the model name with openai/. On AtmoRouter the base URL ends in /v1. The surprise comes next. Aider ships metadata for models it already knows, and catalogue IDs such as zai/glm-5.3 are not in that list, so it warns about an unknown model, assumes an unlimited context window and prints a session cost of zero.

The fix is a .aider.model.metadata.json file with per-token prices and token ceilings, keyed to the exact string you pass to --model. The guide converts the per-million rates into per-token values and shows the catalogue price table it worked from, with the reminder that rates refresh.

It also argues for splitting Aider's three call types: commit messages and history summaries to a flash-tier model, diffs to a mid-tier editor model, and the expensive reasoning to the main chat, optionally in architect mode. Illustrative arithmetic puts a fifty-turn session near eight cents on one tier and near fifty-seven cents on another. The post is AtmoRouter-authored rather than independent reporting.

Sources

Choose English or Indonesian. Up to two editions a day. Unsubscribe anytime.