Aider

Moth DocsTutorials

Aider, the coding assistant for the terminal, reaches Moth through two environment variables and a model name.

shell
export OPENAI_API_BASE=https://api.runmoth.si/v1
export OPENAI_API_KEY=moth_your_key_here
aider --model openai/claude-sonnet-4.6

The openai/ in front of the Moth ID tells Aider to use an OpenAI-compatible API. The banner Aider prints when it starts names the model, and a small edit to a file in your project shows the whole loop works.

The unknown model warning

Aider warns that it doesn't know a Moth model's context window and price, and then assumes defaults. To give it the window, save the file below as .aider.model.metadata.json in your home folder or the project's root, with one entry for each model you use.

.aider.model.metadata.json
{
  "openai/claude-sonnet-4.6": {
    "max_input_tokens": 200000,
    "max_output_tokens": 8192,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}

Aider would show the cost of each call as zero, so read what you spent in Moth Console instead. --no-show-model-warnings hides the warning without the file.

A request a model can't take is refused with a 400 that says why. Some tools send stop sequences, which the GPT, Grok, DeepSeek and Kimi models refuse, so pick a Claude or Gemini model if you see that. What is removed lists every setting and what happens to it.