LZLZL/AI toolchain/Access · Mechanics
FREEMedium · Practice B · Accessmechanics

Four clients, four places
to put the endpoint

2026-08-21 · The previous page was why. This one is where

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.

1Claude Code (terminal)

WayHowWhen
EnvironmentExport ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN (or ANTHROPIC_API_KEY)Quick test, or one terminal only
Settings fileInto the env block of settings.jsonPick this for anything lasting — immune to how the app was launched, see §2
"env": { "ANTHROPIC_BASE_URL": "https://…", "ANTHROPIC_API_KEY": "…" }

Which layer matters — the precedence table from page 2 pays off here:

Put it inResult
~/.claude/settings.jsonEvery project uses that endpoint. Usually what you want
.claude/settings.local.jsonThis project only, not committed. Anything containing a key belongs here or at the user layer
.claude/settings.jsonThis one is committed. Endpoint fine, key never

2Claude Code (editor): nothing to do

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.

Which is exactly where the trap bites

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.

3Codex

Edit ~/.codex/config.toml. Two parts: choose at the top, define below.

model = "…" model_provider = "myproxy"
[model_providers.myproxy] name = "…" base_url = "https://…" env_key = "OPENAI_API_KEY" wire_api = "…"
Do not collide with reserved IDsopenai / ollama / lmstudio are built in — a collision is silently ignored, not an error
env_key is a variable name, not a keyIt says which env var to read, not what the key is
wire_api must matchresponses vs chat-completions; wrong choice reads like "model not supported"

4Always-on agent (Hermes)

Needed from stage C onward, listed here so it is all in one place. Settings live in ~/.hermes/config.yaml, keys in ~/.hermes/.envhermes config set routes them automatically: keys to .env, everything else to the YAML.

provider · model · base_url

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.

Separate files is not just tidiness

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.

5Debugging in dependency order

When it will not connect, do not start twiddling settings. Work down the chain — a layer below a failing layer tells you nothing:

#CheckTypical symptom when it fails
1Is the config even readBehaviour totally unchanged → wrong layer, or environment not inherited (§2)
2Is the address reachableConnection error, timeout → wrong address, or a path segment too many/few
3Does auth pass401/403 → key not picked up (check the var named by env_key actually has a value)
4Is the protocol rightHardest to spot: no error, weird fields, empty replies, tool calls dead → check wire_api
5Is the model name rightModel-not-found errors → names are not portable between vendors
6Does tool calling workChat fine, tools broken → for an agent that means unusable
Three silent failures worth memorising

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.

6My own layer

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.

Claude Code 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 ~/.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 ~/.hermes/config.yaml + ~/.hermes/.env; hermes config set routes keys into .env; slots share provider / model / base_url. Official docs, checked 2026-08-21.
Limits The debugging order is general experience, not a documented procedure; no authoritative list exists of which endpoints speak which protocol.
Not in this page Comparisons or recommendations among relay services, my own config or endpoint address.

RelatedRead next

B · Access
What a relay API actually is
B · Access
Where the tokens actually go
A · Local
Into the editor: two routes, two prices
C · Always-on
Hermes Agent: where OpenClaw leads next
An educational and engineering record — not a review or endorsement of any third-party product. Commands, config keys, prices and terms are per each vendor's official docs; this page states when it was checked and all of them can change without notice — verify before you copy anything. Self-hosting is your own responsibility: keys, accounts and data are on you.