CLI
Use this section when your AI tool runs from a terminal and reads configuration from environment variables or a local config file. WorldRouter is OpenAI-compatible, so most CLI agents connect by setting two values: a base URL and an API key.
Codex CLI
Use WorldRouter as the OpenAI-compatible endpoint for Codex CLI and the Codex app.
Claude Code CLI
Point Claude Code CLI at WorldRouter's Anthropic-compatible endpoint.

OpenCode CLI
Add WorldRouter as a custom provider in the OpenCode CLI.
Shared prerequisites
- Create a WorldRouter API key in the API Keys dashboard.
- Make sure the team has available credits on the Credits page.
- Know the command your tool uses to launch (
codex,claude,opencode, …).
Common environment pattern
Every CLI guide below exports the WorldRouter key once and aliases it into the variable the tool expects:
WORLDROUTER_API_KEYholds the original key for reuse across shells.OPENAI_API_KEY(orANTHROPIC_AUTH_TOKENfor Claude Code) points at the same value so the CLI picks it up.- The base URL goes into the variable each tool reads (
OPENAI_BASE_URL,ANTHROPIC_BASE_URL, or a config file).
Pick a guide to see the exact exports, config snippets, and launch commands for that tool.
Last updated on