SIGN IN SIGN UP

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

0 0 83 Python

fix(backend/copilot): default CHAT_USE_OPENROUTER back to true for OR observability (#13066)

## Why

[#13034](https://github.com/Significant-Gravitas/AutoGPT/pull/13034)
flipped `CHAT_USE_OPENROUTER` to default `false`, routing the copilot
main client direct to `api.anthropic.com`. We need to revert that
default so **everything copilot-related stays on OpenRouter** — main
turn, title generation, simulation, future builder helpers — to keep
unified observability (request/response broadcasting, cost tracking,
per-call telemetry) in one place.

Direct-Anthropic mode remains supported and opt-in for deployments that
explicitly want to bypass the proxy.

## What

- `ChatConfig.use_openrouter` default flipped from `False` back to
`True`.
- Field description updated to reflect that OR is the default and
direct-Anthropic is opt-in.

No other code changes — all the direct-Anthropic plumbing from #13034
(rate card, model normalizer, boot validators, aux client split, cost
recovery) stays intact and is exercised whenever an operator opts into
`CHAT_USE_OPENROUTER=false`.

## How

```bash
# OpenRouter (new/restored default — for observability)
# No env vars required; existing OPEN_ROUTER_API_KEY / CHAT_API_KEY are picked up.

# Direct Anthropic (opt-in — bypass OR proxy)
CHAT_USE_OPENROUTER=false
ANTHROPIC_API_KEY=sk-ant-...
# (optional) CHAT_AUX_API_KEY=sk-or-v1-...   # keep aux on OR
```

### Test plan

- [x] `pytest
backend/copilot/{config,anthropic_rate_card,model_normalize}_test.py` —
77 passed locally
- [x] Field default verified at `backend/copilot/config.py:417` →
`default=True`
Z
Zamil Majdy committed
16017b126f2471f4b5cc5ec43991743f997115bd
Parent: 51014b6
Committed by GitHub <noreply@github.com> on 5/9/2026, 3:06:06 AM