Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.requesty.ai/llms.txt

Use this file to discover all available pages before exploring further.

Claude Code is Anthropic’s powerful AI coding assistant that works directly in your terminal and IDE. Using the Requesty integration, you can:
  • Use 300+ models while coding, giving you flexibility to choose the best model for each task.
  • Track and manage your spend in a single location
  • Keep a record of your conversations

Configuration

You can configure Claude Code using the settings files. You will only have to edit it once. Create or edit your settings file: ~/.claude/settings.json And set the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN values inside the env block:
{
	"env": {
		"ANTHROPIC_BASE_URL": "https://router.requesty.ai",
		"ANTHROPIC_AUTH_TOKEN": "your_requesty_api_key",
		"ANTHROPIC_MODEL": "anthropic/claude-sonnet-4-5"
	}
}

2. Quick setup using environment variables

You can also integrate Requesty with Claude Code through environment variables:
  1. Get Your API Key Create an API key on the API Keys Page.
  2. Set Environment Variables
    export ANTHROPIC_BASE_URL="https://router.requesty.ai"
    export ANTHROPIC_AUTH_TOKEN="your_requesty_api_key"
    export ANTHROPIC_MODEL="anthropic/claude-sonnet-4-5"
    
We recommend using the ANTHROPIC_MODEL environment variable, and not the /model directive as Claude might not accept it sometimes.
  1. (Optional) Enable Analytics Additionally, you can track cost per branch, repo, and developer by installing the Requesty analytics wrapper:
    curl -fsSL https://www.requesty.ai/claude/install.sh | bash
    
    Then restart your terminal or run source ~/.zshrc (or ~/.bashrc). Every Claude Code session will now automatically tag requests with your git branch, repo, and username — visible in your Requesty dashboard.
  2. Run Claude Run claude in your terminal.
With this setup, Claude Code will route all requests through Requesty, giving you access to models from OpenAI, Anthropic, Google, Mistral, and many more providers.

Model Selection

You can choose any model from the Model Library or any policy configured for your organization. Standard model IDs follow the format provider/model-name:
  • anthropic/claude-3-7-sonnet
  • openai/gpt-4o
  • google/gemini-2.0-flash-exp
  • mistral/mistral-large-2411
Policies follow the format policy/policy-name:
  • policy/reliable-sonnet-4-5

Command Line Configuration

You can also configure Claude Code using the command line:
# Set the model globally
claude config set -g model "anthropic/claude-sonnet-4-5"

# Set the model for current project only
claude config set model "openai/gpt-4o"

# Set environment variables globally
claude config set -g env.ANTHROPIC_BASE_URL "https://router.requesty.ai"
claude config set -g env.ANTHROPIC_AUTH_TOKEN "your_requesty_api_key"

Claude Code Analytics

Track exactly how much each branch, repo, and developer costs in Claude Code. One command installs a lightweight shell wrapper that tags every Claude Code session with metadata — visible in your Requesty dashboards.

What you get

  • Cost per branch — see which feature branch is burning the most credits
  • Cost per repo — break down spend across multiple repositories
  • Cost per developer — know who’s spending what
  • Agent version tracking — see which Claude Code version is generating spend

Install

curl -fsSL https://www.requesty.ai/claude/install.sh | bash
Then restart your terminal or run source ~/.zshrc (or ~/.bashrc). That’s it. Every Claude Code session will now automatically send these headers to Requesty:
HeaderValue
X-Requesty-BranchCurrent git branch
X-Requesty-Repoorg/repo from git origin
X-Requesty-Ai-AgentClaude Code version
X-Requesty-UserOS username
Headers are set once at session launch and sent only to Requesty — they are stripped before forwarding to any AI provider. No data leaves Requesty’s gateway.

How it works

The installer appends a small shell function to your ~/.zshrc or ~/.bashrc that wraps the claude command. Each time you start Claude Code, it reads your git context and sets ANTHROPIC_CUSTOM_HEADERS before launching. The wrapper is ~10 lines and fully visible in your rc file.

Uninstall

Remove the block between # --- Requesty header injection --- markers in your shell rc file, or just delete the claude() function.

Custom headers

You can add your own X-Requesty-* headers for additional dimensions. See Request Metadata for more.

Benefits of Using Requesty with Claude Code

Access 300+ Models

Switch between models from different providers without changing your setup

Cost Management

Monitor spending and set limits across all your AI interactions

Fallback Policies

Automatic fallbacks ensure your coding sessions never get interrupted

Troubleshooting

Model Not Found

If you get a “model not found” error, make sure:
  • Your API key is valid and has access to the model (check the approved models in your organization)
  • The model ID format is correct (provider/model-name)
  • The model is available in the Model Library

Connection Issues

If Claude Code can’t connect:
  • Verify your ANTHROPIC_BASE_URL is set to https://router.requesty.ai
  • Check your ANTHROPIC_AUTH_TOKEN is correct
  • Ensure you have internet connectivity
Last modified on May 8, 2026