Guides
Use ezrouter with coding agents
Most terminal coding agents accept either an OpenAI-compatible or Anthropic-compatible base URL. ezrouter exposes both surfaces against the same set of upstream models, so plugging an agent in is usually one base-URL change and one API key.
This page is the cross-agent overview. Each agent has its own page with the exact configuration shape.
Pick a surface
| You want… | Use this surface | Base URL |
|---|---|---|
| Drop-in for an OpenAI client (Python, Node SDK) | OpenAI-compat | https://www.ezrouter.dev/v1 |
| Anthropic SDK, Claude Code, extended thinking, prompt caching | Anthropic-compat | https://www.ezrouter.dev/anthropic (Claude Code) or https://www.ezrouter.dev/anthropic/v1 (Anthropic SDK) |
Both surfaces accept the same API key. The choice is about what the agent expects to see on the wire, not about your account.
Per-agent pages
| Agent | Surface | Page |
|---|---|---|
| Claude Code | Anthropic-compat | Claude Code |
| OpenCode | either | OpenCode |
| GitHub Copilot Chat | OpenAI-compat (via bridge extension) | GitHub Copilot |
| CC Switch (desktop GUI for the above) | either | CC Switch |
For agents not listed above, follow the generic pattern below.
Generic pattern
Whatever agent you are configuring, three values get it talking to ezrouter:
- Base URL.
https://www.ezrouter.dev/v1(OpenAI-compat) or
https://www.ezrouter.dev/anthropic / .../anthropic/v1 (Anthropic-compat, depending on whether the agent appends /v1).
- API key. From the
dashboard. Sent as Authorization: Bearer ... (OpenAI surface) or x-api-key: ... (Anthropic surface). Both work on the Anthropic surface.
- Model ID. Any value from
GET /v1/models. Common choices: claude-sonnet-4-6 for general coding, claude-haiku-4-5 for cheap helper calls, deepseek-v4-pro for long-context work, claude-opus-4-7 when you want the strongest model.
Most agents take these as environment variables or a config file entry. The agent-specific pages above document exact variable names.
Feature reliability by model
Not every feature works on every routed model. The state of play as of 2026-05-27:
| Feature | Reliable on | Caveat |
|---|---|---|
| Plain chat | all 9 catalog models | — |
| Streaming | all | gateway always streams; client must handle SSE |
| Tool calls | claude-opus-4-7 | other claude models and most non-claude models do not reliably emit parseable tool_call deltas on the OpenAI surface (see tool calls) |
| Extended thinking | claude family on Anthropic surface | OpenAI surface drops reasoning_content across multi-turn (see thinking mode) |
| Prompt caching | claude-haiku/sonnet, deepseek, glm, kimi | claude-opus-4-7 does not auto-cache; see KV cache |
| Prefix completion | none | prefix parameter is rejected on the OpenAI surface today |
| JSON mode | all | see JSON output |
For agent workflows that lean on tool calls or thinking, prefer the Anthropic surface and claude-opus-4-7. For high-volume completions, the deepseek and kimi families are cheaper.
Troubleshooting
401 invalid_api_key— the token is wrong, expired, or has
trailing whitespace.
403 access_denied— the model is not in your key's allowlist.
Query GET /v1/models.
- Agent hangs on long requests — ezrouter does not return 429
under load; latency growth is the throttle signal.
- Tool call never fires — verify the agent is on
claude-opus-4-7 or the Anthropic surface. See tool calls.
Related
- Anthropic API — how the Anthropic surface
works at the protocol level.
- API reference — surface options
and divergences.