Disclosure: I'm on the team that builds RABAH.AI, the gateway used in this post. The manual steps below work with any OpenAI- or Anthropic-compatible gateway.
If you run more than one coding agent, you know the routine: one key for Claude Code, another for Codex, two dashboards, two bills, and a small worry that an agent stuck in a loop will burn through your budget overnight.
This post shows how to point both agents at a single API key, two ways:
https://api.rabah.ai.
Rabah Desktop (Mac with Apple silicon, Windows 10/11) signs in to your account and writes the API settings for your local agents.
That's it. Restart the agents once so they read the new settings.
Add three entries to the "env" block of ~/.claude/settings.json (keep any settings you already have):
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.rabah.ai",
"ANTHROPIC_AUTH_TOKEN": "YOUR_KEY",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}
To try it in one terminal session first instead:
export ANTHROPIC_BASE_URL="https://api.rabah.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_KEY"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
In ~/.codex/config.toml, add a provider that uses the Responses API:
model_provider = "OpenAI"
model = "MODEL_NAME"
[model_providers.OpenAI]
name = "OpenAI"
base_url = "https://api.rabah.ai/v1"
wire_api = "responses"
requires_openai_auth = false
experimental_bearer_token = "YOUR_KEY"
Replace MODEL_NAME with a model from the gateway's model list. Keep the top-level lines above the [model_providers...] section, or Codex ignores them.
Then quit Codex completely and reopen it. A new conversation isn't enough, because Codex reads the config only at startup.
This is the part I'd do even if you only run one agent. An agent in a retry loop can send a lot of requests before you notice.
Rabah Desktop also connects your computer to the Rabah phone app. From your phone you can send tasks, check progress, approve steps, or and resume the agents running on your machine. Remote sessions are end-to-end encrypted, and the computer needs to stay online and awake.
One key, two agents, spend capped per key and per account. If you set this up a different way, or hit a snag, tell me in the comments. I'd like to hear what's missing.
Docs: docs.rabah.ai/en/