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 surfaceBase URL
Drop-in for an OpenAI client (Python, Node SDK)OpenAI-compathttps://www.ezrouter.dev/v1
Anthropic SDK, Claude Code, extended thinking, prompt cachingAnthropic-compathttps://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

AgentSurfacePage
Claude CodeAnthropic-compatClaude Code
OpenCodeeitherOpenCode
GitHub Copilot ChatOpenAI-compat (via bridge extension)GitHub Copilot
CC Switch (desktop GUI for the above)eitherCC 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:

  1. 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).

  1. API key. From the

dashboard. Sent as Authorization: Bearer ... (OpenAI surface) or x-api-key: ... (Anthropic surface). Both work on the Anthropic surface.

  1. 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:

FeatureReliable onCaveat
Plain chatall 9 catalog models
Streamingallgateway always streams; client must handle SSE
Tool callsclaude-opus-4-7other claude models and most non-claude models do not reliably emit parseable tool_call deltas on the OpenAI surface (see tool calls)
Extended thinkingclaude family on Anthropic surfaceOpenAI surface drops reasoning_content across multi-turn (see thinking mode)
Prompt cachingclaude-haiku/sonnet, deepseek, glm, kimiclaude-opus-4-7 does not auto-cache; see KV cache
Prefix completionnoneprefix parameter is rejected on the OpenAI surface today
JSON modeallsee 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.

works at the protocol level.

and divergences.