Skip to main content
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

1. Quick setup using environment variables

The easiest way to integrate Requesty with Claude Code is 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. 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.
You can also 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",
	}
}

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"

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