How can one API key configure Claude Code, Codex, and Gemini CLI?
The same key works in all three clients. The protocol, environment variables, and config file stay different. Do not copy one client's config into another.
Prepare
- Copy one key from API Keys.
- Save an endpoint for Claude, OpenAI, and Gemini on Endpoint selection.
- Install Node.js first if you need it: environment setup.
Fill each client
| Client | Where the key goes | Address field | Watch out |
|---|---|---|---|
| Claude Code | ANTHROPIC_AUTH_TOKEN | ANTHROPIC_BASE_URL | Do not set CLAUDE_CODE_ATTRIBUTION_HEADER=0 |
| Codex | auth.json, written by codex login --with-api-key | base_url in config.toml | Do not put the key in config.toml |
| Gemini CLI | GEMINI_API_KEY | GOOGLE_GEMINI_BASE_URL | Domain only. Do not add /v1beta |
Start every address at https://api.icodeeasy.cc. If one client is slow, change only that client's address to https://jp.icodeeasy.cc or https://sg.icodeeasy.cc.
Check model capabilities before you assume a model works in that client. After setup, send one short message from each client and confirm three separate rows in request logs.
Related guides
Install Claude Code, Configure a Custom API, and Troubleshoot Windows
Install Claude Code, configure a custom API key and URL, verify Windows or Unix settings, and troubleshoot authentication, rate limits, and connections.
Codex Setup
Install Codex CLI, store the API key in auth.json, configure the I Code Easy provider and Base URL, and start a first Codex session.
Gemini CLI Setup
Install Gemini CLI, configure authentication and the custom service domain, then use strict non-streaming JSON, SSE responses, and the video analysis demo correctly.