Model roles
Give one client three models — main loop, subagents, and background calls — and mix providers freely.
Coding agents do not make one kind of call. They make three, and the pages that follow each show where to set them for a specific client.
| Role | What runs there | Why it matters |
|---|---|---|
| Main loop | The model you are talking to | Most of the quality |
| Subagents | Parallel workers a task fans out to | Most of the tokens |
| Background | Titles, summaries, file descriptions | Small, constant, easy to overpay for |
Background calls fire on almost every interaction and are invisible. Leaving that slot on a frontier model is the most expensive default in agentic coding.
Set all three at once
npx @webway/connect --key $WEBWAY_API_KEY
This reads your catalogue, detects the clients you have installed, and prints
the configuration each one needs. Nothing is written until you add --write.
npx @webway/connect --main <expensive> --sub <mid> --fast <cheap> --write
npx @webway/connect --models # what your key can reach
Existing config files are merged, not replaced.
Where each client keeps them
Not every client splits all three. Where one does not, the main-loop model runs everything.
| Client | Main loop | Subagents | Background |
|---|---|---|---|
| Claude Code | ANTHROPIC_DEFAULT_OPUS_MODEL |
ANTHROPIC_DEFAULT_SONNET_MODEL, or model: in an agent's frontmatter |
ANTHROPIC_DEFAULT_HAIKU_MODEL |
| Codex CLI | model |
a [profiles.*] block, selected with --profile |
same |
| OpenClaw | agents.defaults.model.primary |
per-agent entries under agents |
per-agent entries under agents |
| Hermes | hermes model |
— | — |
| TRAE SOLO | the selected custom model | — | — |
| The OpenAI and Anthropic SDKs | the model argument |
— | — |
Claude Code is the clearest case: its three ANTHROPIC_DEFAULT_* variables are
exactly these three roles, and the Haiku slot is what its background work uses.
Mixing providers
The three models do not have to come from one provider. Every model is reachable from every endpoint, so a client that speaks only one protocol can still run a main loop on one vendor and subagents on another:
npx @webway/connect claude-code \
--main anthropic/claude-opus-5 \
--sub openai/gpt-5.6-terra \
--fast deepseek/deepseek-v4-flash --write
Claude Code speaks Anthropic Messages throughout. Webway translates the two requests that are not going to Anthropic. See Protocol translation for what that costs.