Docs · Integrations
Aider with TopxAI: OPENAI_API_BASE and the model name
Run aider against TopxAI with OPENAI_API_BASE=https://ai.topxea.com/v1 and --model openai/claude-sonnet-5, or the Anthropic variables for the Claude line.
Aider uses LiteLLM underneath, so any OpenAI-compatible endpoint works through the openai/ prefix, and the Anthropic endpoint through anthropic/.
OpenAI-compatible (every text model)
export OPENAI_API_BASE=https://ai.topxea.com/v1
export OPENAI_API_KEY=sk-... # a TopxAI key on the Auto route
aider --model openai/claude-sonnet-5
Any catalogue id except Jev goes after openai/: openai/gpt-5.6-sol, openai/grok-4.6, openai/kimi-k3, openai/GLM-5.3-Abliterated.
Anthropic (Claude, with prompt caching)
export ANTHROPIC_API_BASE=https://ai.topxea.com
export ANTHROPIC_API_KEY=sk-...
aider --model anthropic/claude-sonnet-5 --cache-prompts
--cache-prompts turns on Aider's cache breakpoints; TopxAI forwards them and bills cache reads at one tenth of the input price.
Model metadata
Aider warns when it has no context-window or price data for a model name. Add a .aider.model.metadata.json next to your project so the warnings stop and the token meter is right:
{
"openai/claude-sonnet-5": {
"max_input_tokens": 1000000,
"max_output_tokens": 128000,
"input_cost_per_token": 0.000001,
"output_cost_per_token": 0.000005,
"litellm_provider": "openai",
"mode": "chat"
}
}
The costs above are the shared-pool prices from the model's page; Aider uses them only for its running total, the actual charge is in the TopxAI usage log.
Persisting it
Put the same values in ~/.aider.conf.yml (model: openai/claude-sonnet-5, openai-api-base: https://ai.topxea.com/v1) and the key in ~/.aider/oai.env or your shell profile.
If it fails
401: the key is wrong or was pasted with a space. 402: the balance is empty. 403: the model id is not sold here or is not on this key's route. See Common error responses.
The model works in curl but not in the tool: that page lists the usual causes, one per tool.
Available in: en, zh-CN