接入 · Aider

在 Crazyrouter 模型上运行 Aider

Aider 的 OpenAI 兼容模式对 Crazyrouter 开箱即用。两个环境变量加一个模型参数;提交信息和摘要用便宜的 weak model。

手动配置

先用官方安装脚本(aider.chat/install.sh 或 install.ps1)装 Aider,再指向 Crazyrouter。openai/ 前缀是让 LiteLLM 使用自定义 Base URL 的关键。

环境变量 + 启动

bash
export OPENAI_API_KEY=sk-your-crazyrouter-key
export OPENAI_API_BASE=https://api.crazyrouter.com/v1
aider --model openai/claude-opus-4-8

Aider 经由 LiteLLM,模型名前加 openai/ 强制走 OpenAI 兼容路由。

或 ~/.aider.conf.yml

yaml
openai-api-key: sk-your-crazyrouter-key
openai-api-base: https://api.crazyrouter.com/v1
model: openai/claude-opus-4-8
weak-model: openai/deepseek-v4-flash
Base URL 规则

https://api.crazyrouter.com/v1 — 这个工具是 OpenAI 兼容的,会自己拼 /chat/completions(或 /responses),Base URL 按上面所示带 /v1。

常见问题

为什么要 openai/ 前缀?

Aider 经由 LiteLLM 路由,前缀选中 OpenAI 兼容 provider,任何模型名都会走 OPENAI_API_BASE。

Aider 提示模型未知

那是 LiteLLM 对自定义名字的元数据警告,请求照常工作。想让它识别 token 上限可加 .aider.model.metadata.json。

weak model 用什么?

deepseek-v4-flash,Aider 频繁调用的提交信息和摘要几乎不花钱。

相关指南与对比

Podcast

AI Dev Tools: The Crazyrouter Podcast

面向开发者的英文短节目:AI API、网关、成本控制与编程工具。

最新节目

  • EP196 · 2026年10月29日 · 6:53

    AI API Security Posture — Turn Controls Into Continuous Evidence

    A practical guide to AI API security posture: inventory exposure, verify controls continuously, protect keys and data, constrain tools, and turn security assumptions into evidence that operators can act on.

  • EP195 · 2026年10月28日 · 7:21

    AI API Policy Drift — Detect When Production Rules Stop Matching Intent

    A practical guide to policy drift in AI APIs: version routing and safety rules, detect stale enforcement, compare intended and observed behavior, and restore control before small gaps become incidents.

Episodes with written show notes →