WorldRouter

Skip to Content
CLI agentsOverview

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.

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_KEY holds the original key for reuse across shells.
  • OPENAI_API_KEY (or ANTHROPIC_AUTH_TOKEN for 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