$Revo Mail Docs

Claude Code CLI

Configure Anthropic's Claude Code CLI to route through Revo Mail for unified billing and model access.

What This Does

Claude Code is Anthropic's official CLI for AI-assisted development. By configuring it to use Revo Mail's endpoint, you can use any supported model — not just Claude — while consolidating all your AI spend under a single Revo Mail account. Your token usage draws from your Revo Mail balance automatically.


Setup

Step 1: Locate Your Settings File

Claude Code stores its configuration in a settings.json file. Find it based on your OS:

OSPath
macOS / Linux~/.claude/settings.json
Windows%USERPROFILE%\.claude\settings.json

If the file doesn't exist, create it.

Step 2: Configure Environment Variables

Open settings.json and add the following configuration:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.revomail.io/",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_Revo Mail_API_KEY",
    "ANTHROPIC_MODEL": "gpt-5.4",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.3-codex",
    "ANTHROPIC_SMALL_FAST_MODEL": "glm-5-turbo"
  }
}

Replace YOUR_Revo Mail_API_KEY with your actual key from revomail.io/keys.

Step 3: Alternative — Environment Variables in Shell

If you prefer not to modify the settings file, set environment variables in your shell:

export ANTHROPIC_BASE_URL="https://api.revomail.io/"
export ANTHROPIC_AUTH_TOKEN="YOUR_Revo Mail_API_KEY"

Add these to your ~/.zshrc or ~/.bashrc to persist across sessions.

Step 4: Verify the Connection

Run Claude Code and start a conversation:

claude

Try a simple prompt to confirm the connection works.


Use CaseModelWhy
Complex reasoning & planninggpt-5.4Highest capability
Code generation & refactoringgpt-5.3-codexOptimized for code
Large codebase analysisgemini-3.1-pro1M+ token context
Quick operationsglm-5-turboFast, low latency
Budget workloadsglm-5Cost-effective

Troubleshooting

Connection refused or timeout

  • Verify the base URL is exactly https://api.revomail.io/ (with trailing slash for Claude Code)
  • Check that your API key is valid at revomail.io/keys

Authentication errors

  • Ensure ANTHROPIC_AUTH_TOKEN is set, not ANTHROPIC_API_KEY — Claude Code expects the token variant
  • Remove any quotes around the key if you're setting it via shell export

Model not found errors

  • Use model slugs exactly as shown in the Models reference
  • Claude Code may require you to specify a model explicitly if the default isn't recognized

Notes

  • Claude Code was designed for Claude models but works with any OpenAI-compatible endpoint
  • The ANTHROPIC_SMALL_FAST_MODEL is used for background tasks — set it to a low-cost model
  • All token consumption appears in your Revo Mail dashboard in real-time

On this page