The previous page settled the mechanism: three knobs — address, key, model. This page answers one question only: where do your hands go.
In this pagefour config locations, a debugging order, silent failures. Not in this pagewhich relay is better — this site runs no relay comparisons, see page 7 §7. Nor my own config.
| Way | How | When |
|---|---|---|
| Environment | Export ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN (or ANTHROPIC_API_KEY) | Quick test, or one terminal only |
| Settings file ✅ | Into the env block of settings.json | Pick this for anything lasting — immune to how the app was launched, see §2 |
Which layer matters — the precedence table from page 2 pays off here:
| Put it in | Result |
|---|---|
~/.claude/settings.json | Every project uses that endpoint. Usually what you want |
.claude/settings.local.json | This project only, not committed. Anything containing a key belongs here or at the user layer |
.claude/settings.json | ⚠ This one is committed. Endpoint fine, key never |
Literally nothing. The extension and the CLI share ~/.claude/settings.json,
so §1 already covered it. That is the main reason page 4 favours the extension route.
If you chose the environment variable route in §1, the editor probably cannot see it — GUI-launched processes do not inherit a login shell. The symptom: fine in the terminal, still prompting to sign in inside the editor.
Documented fix: start it with code . from a terminal.
The easier fix is not to use environment variables at all — hence the ✅ above.
Edit ~/.codex/config.toml. Two parts: choose at the top, define below.
| ⚠ | |
|---|---|
| Do not collide with reserved IDs | openai / ollama / lmstudio are built in — a collision is silently ignored, not an error |
env_key is a variable name, not a key | It says which env var to read, not what the key is |
wire_api must match | responses vs chat-completions; wrong choice reads like "model not supported" |
Needed from stage C onward, listed here so it is all in one place.
Settings live in ~/.hermes/config.yaml, keys in ~/.hermes/.env —
hermes config set routes them automatically: keys to .env, everything else to the YAML.
And every slot is the same three — main model, auxiliary tasks, context compression, fallback. So the main model can sit on one provider while cheap high-frequency work sits on another, which the next page puts to use.
It makes the backup list workable:
config.yaml can go into your backup or even a private repo, with .env excluded.
Tools that mix config and secrets in one file force you to handle the whole thing carefully.
When it will not connect, do not start twiddling settings. Work down the chain — a layer below a failing layer tells you nothing:
| # | Check | Typical symptom when it fails |
|---|---|---|
| 1 | Is the config even read | Behaviour totally unchanged → wrong layer, or environment not inherited (§2) |
| 2 | Is the address reachable | Connection error, timeout → wrong address, or a path segment too many/few |
| 3 | Does auth pass | 401/403 → key not picked up (check the var named by env_key actually has a value) |
| 4 | Is the protocol right | Hardest to spot: no error, weird fields, empty replies, tool calls dead → check wire_api |
| 5 | Is the model name right | Model-not-found errors → names are not portable between vendors |
| 6 | Does tool calling work | Chat fine, tools broken → for an agent that means unusable |
They share one property — no error — which is why they eat time:
① the config is not being read at all — you are editing a file that does nothing;
② a Codex provider ID collided with a reserved name — the table is ignored, looks unconfigured;
③ wrong protocol — chats fine, tool calling quietly dead.
One technique finds all three: make a change that must visibly break something (put a deliberately wrong address in). If nothing changes, your problem is at layer 1, not the layer you were tuning.
What you put in that address field is your call — this site does not compare or recommend these services. One fact for the record: the relay layer I use myself is acetoken.ai.
For how to choose, go back to page 7 §5: not the cheapest, but whether you are willing for every party on that path to see what you send.
ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN /
ANTHROPIC_API_KEY / ANTHROPIC_MODEL; settable in the env block of
settings.json; precedence managed > CLI > .claude/settings.local.json >
.claude/settings.json > ~/.claude/settings.json; extension and CLI share
~/.claude/settings.json. Official docs, checked 2026-08-21.~/.codex/config.toml (CODEX_HOME); top-level model /
model_provider; [model_providers.ID] with name, base_url,
env_key, wire_api, query_params, http_headers,
env_http_headers; reserved IDs openai, ollama, lmstudio.
Official docs, checked 2026-08-21.~/.hermes/config.yaml + ~/.hermes/.env;
hermes config set routes keys into .env; slots share
provider / model / base_url. Official docs, checked 2026-08-21.