Claude Code & Codex CLI Base URL config generator
Pick a tool, your OS and an endpoint. Get copy-paste env vars, ~/.claude/settings.json, ~/.codex/config.toml or SDK snippets for any API relay, gateway or self-hosted proxy (LiteLLM, one-api, new-api, your own).
๐ Privacy: this page makes no network requests. Everything is generated by JavaScript in your browser. If you type a real key it never leaves this tab and is not saved in the URL. Safer still: keep the placeholder and paste your key into the file yourself. Source.
Which URL goes where?
| Client | Setting | What it appends | Typical value |
|---|---|---|---|
| Claude Code | ANTHROPIC_BASE_URL | /v1/messages | https://gateway.example.com (no /v1) |
| Codex CLI | [model_providers.<id>] base_url | /responses | https://gateway.example.com/v1 |
| OpenAI SDKs | base_url / baseURL / OPENAI_BASE_URL | /chat/completions, /models | https://gateway.example.com/v1 |
Rule of thumb: a 404 almost always means the prefix is wrong (missing or doubled /v1). Check your gateway's docs for its exact paths. To test an endpoint from the terminal, try llm-endpoint-check; for a step-by-step guide with troubleshooting see Claude Code & Codex CLI with a custom Base URL.