Connecting Claude Code, Cursor, Codex and the rest
The tools you code with every day reach every model with one address and one key.
Coding tools usually have somewhere to put an address and a key. Give IranRouter's address instead of the default. Make a separate key for each tool, so each one's spending shows on its own.
The panel's home also has a Connect card with ready commands for several tools.
Claude Code
export ANTHROPIC_BASE_URL="https://iranrouter.com/anthropic" export ANTHROPIC_API_KEY="ir-..." claude
The prefix is /anthropic, not /v1, because Claude Code appends /v1/messages itself.
Cursor
In Settings under Models, put your key in OpenAI API Key, turn on Override OpenAI Base URL and enter this address. Then add the model by its full id as a custom model.
https://iranrouter.com/v1
Codex
Codex only speaks the /responses route. Put this in ~/.codex/config.toml and keep the key in the IRANROUTER_KEY environment variable:
model = "openai/gpt-5.6-sol" model_provider = "iranrouter" [model_providers.iranrouter] name = "IranRouter" base_url = "https://iranrouter.com/v1" env_key = "IRANROUTER_KEY" wire_api = "responses"
Codex's own web search works too, and each search has its own fixed charge on top of the tokens. Its other tools work as well, file edits included.
Gemini CLI
export GOOGLE_GEMINI_BASE_URL="https://iranrouter.com/genai" export GEMINI_API_KEY="ir-..." gemini -m google/gemma-4-31b-it
On the first run, choose Gemini API Key as the sign-in method.
Continue and the rest
models:
- name: Claude via IranRouter
provider: openai
model: anthropic/claude-sonnet-4.6
apiBase: https://iranrouter.com/v1
apiKey: ir-...Any other tool that takes a base_url connects the same way. The full list is in the tools guide.
To make variables permanent, put those export lines in ~/.zshrc or ~/.bashrc.
Connect your own tool0 of 3 steps
- Make a separate key with a monthly cap for your tool.
- Enter the setting above and give the tool a small job.
- On the panel's home or in the logs, see that the tool is recognised by name.
A quick check
Just for you: your answers aren't sent anywhere.
What you learned
- The address and key go in the tool's settings.
/anthropicfor Claude Code,/genaifor Gemini CLI,/v1for the rest.- Next: how OpenClaw carries a job through.
Keep your place
Sign in to the panel and each lesson and your path are saved, so you continue from the same spot on any device.