Claude Code is Anthropic’s powerful AI coding assistant that works directly in your terminal and IDE. With Requesty integration, you can access 300+ models while coding, giving you flexibility to choose the best model for each task.

Quick Setup

The easiest way to integrate Requesty with Claude Code is through environment variables:
  1. Set Environment Variables
    export ANTHROPIC_BASE_URL="https://router.requesty.ai"
    export ANTHROPIC_API_KEY="your_requesty_api_key"
    
  2. Get Your API Key Create your API key on the API Keys Page in the platform.
  3. Choose Your Model You can now use any Requesty model by configuring the model setting in Claude Code.
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.

Advanced Configuration

Using Settings Files

For more control, you can configure Claude Code using settings files. Create or edit your settings file: Global Settings: ~/.claude/settings.json
{
	"model": "anthropic/claude-3-7-sonnet",
	"env": {
		"ANTHROPIC_BASE_URL": "https://router.requesty.ai",
		"ANTHROPIC_API_KEY": "your_requesty_api_key"
	}
}
Project Settings: .claude/settings.json
{
	"model": "openai/gpt-4o",
	"env": {
		"ANTHROPIC_BASE_URL": "https://router.requesty.ai",
		"ANTHROPIC_API_KEY": "your_requesty_api_key"
	}
}

Model Selection

You can choose any model from the Model Library. Model IDs follow this format:
  • Standard Models: provider/model-name
    • anthropic/claude-3-7-sonnet
    • openai/gpt-4o
    • google/gemini-2.0-flash-exp
    • mistral/mistral-large-2411
  • Coding-Optimized Models: coding/model-name
    • coding/claude-3-7-sonnet
    • coding/gpt-4o
Coding-optimized models provide auto caching of prompts and handle compatibility with reasoning models for better coding experiences.

Command Line Configuration

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

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

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

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

Smart Routing

Intelligent routing to the best available endpoint for optimal performance

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
  • 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_API_KEY is correct
  • Ensure you have internet connectivity

Environment Variables Not Working

Environment variables might not persist between sessions. Add them to your shell profile: For bash/zsh:
echo 'export ANTHROPIC_BASE_URL="https://router.requesty.ai"' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY="your_requesty_api_key"' >> ~/.zshrc
source ~/.zshrc
For more advanced configuration options, check out the Claude Code Settings Documentation.