Product Launch

One Gateway for 3 Coding CLIs (2026): Setup & Troubleshooting — Gemini CLI, Codex CLI, Claude Code

Jessie
Jessie
COO
January 12, 2026
8 min read

Author

Jessie

Jessie

COO

One API for Top AI Models Worldwide – Save 20-70% AI Costs with EvoLink

Category

Product Launch
One Gateway for 3 Coding CLIs (2026): Setup & Troubleshooting — Gemini CLI, Codex CLI, Claude Code

If you use coding CLIs daily, setup friction becomes real cost: multiple API keys, different config formats, auth conflicts, and the classic 401/429/stream-stuck loop.

This post is a copy-paste-first hub that routes Gemini CLI, Codex CLI, and Claude Code (Claude CLI) through a single LLM gateway host (api.evolink.ai), with quick verification and a practical troubleshooting playbook.

Want the shortest path? Use the dedicated integration guides (recommended):


One Endpoint for Coding CLIs
One Endpoint for Coding CLIs

Start here (fastest setup)

Pick your tool and follow the dedicated guide linked in the intro above.


TL;DR: 5-minute checklist (pick your tool)

ToolWhere to configureKey / tokenBase URLVerify
Codex CLI~/.codex/config.tomlOPENAI_API_KEYhttps://api.evolink.ai/v1codex "Who are you"
Claude Code~/.claude/settings.jsonANTHROPIC_AUTH_TOKENhttps://api.evolink.aiclaude "Who are you"
Gemini CLI~/.gemini/.envGEMINI_API_KEYhttps://api.evolink.ai/gemini "Who are you"
Note: Some CLIs require slightly different endpoint shapes (e.g. /v1 or trailing slash). Follow each tool's guide for the exact format that CLI expects.

Why route coding CLIs through a gateway host?

Use a gateway/router when you want one or more of these:

  1. Stop juggling keys across multiple tools
  2. Switch models/providers without rewriting tool configs
  3. Route traffic through one place for operational controls (retries/timeouts/auditing)
  4. Keep your workflow stable as tools and providers evolve

This guide focuses on setup + operational reality: what breaks and how to fix it.

Decision table: direct-to-provider vs one gateway host

Before you commit, here's the real tradeoff in production.

What you care aboutDirect-to-provider CLIsOne gateway host (api.evolink.ai)
Setup across multiple toolsRepeated per toolStandardized entry point
Switching models/providersMore rewiringEasier to centralize and evolve
Observability (cost/latency/errors)Fragmented across vendorsCan be unified at the gateway
Debugging (401/429/stream issues)Tool-by-toolCentral patterns + per-tool adapters
Operational overheadLower infra responsibilityYou operate/choose a gateway layer
Summary: If you only use one CLI and never switch, direct can be fine. If you use multiple CLIs daily, a gateway host typically reduces long-term glue cost.

Path A — Codex CLI (custom provider via config.toml)

Codex CLI supports custom model providers via ~/.codex/config.toml.
Use the dedicated guide in intro above for the full template + FAQs.

Minimal steps

  1. Install:

    npm install -g @openai/codex
  2. Set your API key:

    export OPENAI_API_KEY="YOUR_EVOLINK_KEY"
  3. Create / edit config ~/.codex/config.toml
  4. Verify:

    codex "Who are you"

Minimal config.toml snippet (example)

model = "gpt-5.2"
model_provider = "evolink"

[model_providers.evolink]
name = "EvoLink API"
base_url = "https://api.evolink.ai/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"

Path B — Claude Code / Claude CLI (settings.json + Anthropic base URL)

Claude Code can be configured via ~/.claude/settings.json.
Use the dedicated guide in intro above for the complete template + OS paths + FAQs.

Minimal steps

  1. Install:

    npm install -g @anthropic-ai/claude-code
  2. Edit ~/.claude/settings.json
  3. Verify:

    claude "Who are you"

Minimal settings.json snippet (example)

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_EVOLINK_KEY",
    "ANTHROPIC_BASE_URL": "https://api.evolink.ai",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  },
  "permissions": { "allow": [], "deny": [] }
}

Auth conflict note (common pitfall)

If you previously logged in using a subscription flow and also set an API key/token, behavior may be inconsistent. If you see warnings or unexpected auth behavior:

  • Run claude /logout and re-auth cleanly, and/or
  • Unset conflicting Anthropic env vars, then restart your terminal

Path C — Gemini CLI (.env + custom base URL)

Gemini CLI can load config from ~/.gemini/.env.
Use the dedicated guide in intro above for full steps + FAQs.

Prerequisite

Use Node.js 20+.

Check:

node -v

Minimal steps

  1. Install:

    npm install -g @google/gemini-cli
  2. Create / edit ~/.gemini/.env
  3. Verify:

    gemini "Who are you"

Minimal .env snippet (example)

GOOGLE_GEMINI_BASE_URL="https://api.evolink.ai/"
GEMINI_API_KEY="YOUR_EVOLINK_KEY"
GEMINI_MODEL="gemini-2.5-pro"

Known pitfall: base URL not taking effect

If Gemini CLI still calls the default endpoint after setting GOOGLE_GEMINI_BASE_URL:
  • Restart your terminal session
  • Confirm the .env file path is correct
  • Check the CLI auth mode and cached sessions
  • Re-run with a minimal prompt to isolate config vs prompt/runtime issues

Config not taking effect
Config not taking effect

Why config changes don't take effect (precedence checklist)

Most "it didn't change" issues come from one of these:

  1. Wrong file location — Codex: ~/.codex/config.toml / Claude: ~/.claude/settings.json / Gemini: ~/.gemini/.env
  2. You edited the file but didn't restart — Restart the terminal or the CLI process.
  3. Environment variables override config — Especially relevant for Claude auth conflicts (token vs login).

Quick check:

env | grep -E "OPENAI_API_KEY|ANTHROPIC_|GEMINI_|GOOGLE_GEMINI_BASE_URL"

Troubleshooting cheat sheet
Troubleshooting cheat sheet

Troubleshooting cheat sheet (401/403/429/stream/tool-calls/timeout)

401 / 403 (auth errors)

Fast checks
  • Is your key set in the variable the tool reads?
    • Codex: OPENAI_API_KEY
    • Claude: ANTHROPIC_AUTH_TOKEN
    • Gemini: GEMINI_API_KEY
  • Does your base URL match the endpoint format used by your integration guide?
Fast fixes
  • Re-export the env var and restart your shell
  • Re-check config file location and spelling
  • For Claude: /logout, then re-auth cleanly
Need a fresh key to resolve 401/403? Create / manage API key →

429 (rate limit / quota / throttling)

Fast mitigation
  • Reduce concurrency (avoid many parallel runs)
  • Add small delays between large tasks
  • Retry with exponential backoff (best handled by a gateway/router, when available)

If 429 persists, treat it as an operational issue: burst patterns, long streaming sessions, or heavy tool-calls can amplify the problem.

Stream stuck / long output hangs

Fast checks
  • Try a short prompt to validate connectivity
  • Disable VPN/proxy temporarily to isolate network issues
  • Re-run in a clean directory (avoid huge repo contexts)

Tool-calls fail (agent tries to run commands/files)

Common causes
  • Permission policy blocks execution
  • Tool environment missing dependencies (git, ripgrep, build tools)
  • Path/sandbox restrictions
Fast fix
  • Confirm tool permission policy and working directory
  • Reproduce with a minimal tool action

Timeout

Fast mitigation
  • Split tasks into smaller prompts
  • Reduce repo context size
  • Avoid very long streaming sessions for a first test

Model switching (quick)

  • Codex CLI: Update model = "..." in ~/.codex/config.toml
  • Claude Code: Use /model (if supported by your version)
  • Gemini CLI: Use /model or update GEMINI_MODEL in .env

Next steps

If you're using multiple coding CLIs, the fastest way to reduce friction is to standardize on:

  • A single gateway host
  • Predictable setup templates per tool
  • A repeatable troubleshooting playbook

Start with the dedicated integration guides (see intro above).


FAQ

What is a "custom LLM endpoint" for a coding CLI?

A custom endpoint is a base URL that your CLI sends requests to instead of a default provider endpoint. In practice, it can be a gateway/router that exposes one or more model APIs behind a single host.

Why does this guide show different endpoint formats (/v1, trailing slash) for different tools?

Some CLIs expect a specific URL shape for compatibility. The key idea is using the same gateway host (api.evolink.ai), while matching each CLI's expected endpoint format.

Where is the Codex CLI config file located?

Typically at ~/.codex/config.toml.

How do I set a custom base_url in Codex CLI?

Set base_url under your custom provider section in config.toml.

What does wire_api = "responses" mean in Codex config?

It indicates which API shape the CLI uses when talking to the endpoint. Keep it aligned with your integration guide.

Where is Claude Code settings.json located?

Typically at ~/.claude/settings.json.

What is ANTHROPIC_BASE_URL used for?

It sets the base URL Claude Code sends requests to, enabling routing through a custom endpoint instead of a default provider endpoint.

Why does Claude Code warn about auth conflicts?

Mixing login/subscription auth with API-key/token auth can cause conflicts. /logout, unsetting conflicting env vars, and restarting the shell usually fixes it.

Where does Gemini CLI read .env from?

Gemini CLI can load environment variables from ~/.gemini/.env.

Why doesn't GOOGLE_GEMINI_BASE_URL take effect?

Common reasons: wrong .env path, terminal session didn't reload env vars, or cached auth/session. Restarting and re-checking auth mode helps.

What Node.js version should I use for Gemini CLI?

Use Node.js 20+.

How do I fix 401/403 quickly when using a custom endpoint?

Verify the correct key variable is set, confirm the endpoint format, and restart the terminal. For Claude, also remove auth conflicts by logging out or unsetting variables.

What does 429 mean in coding CLIs?

It typically indicates rate limiting or quota throttling. Reduce concurrency, add delays, and retry with exponential backoff.

My CLI streams output then hangs—what should I try first?

Test with a short prompt, disable VPN/proxy temporarily, and reduce repo context size. Split large tasks into smaller prompts.

Ready to Reduce Your AI Costs by 89%?

Start using EvoLink today and experience the power of intelligent API routing.