Claude Code - WebSearch Across All Providers
Enable Claude Code's web search tool to work with any provider (Bedrock, Azure, Vertex, etc.). LiteLLM automatically intercepts web search requests and executes them server-side.
Proxy Configuration
Add WebSearch interception to your litellm_config.yaml:
litellm_config.yaml
model_list:
- model_name: bedrock-sonnet
litellm_params:
model: bedrock/us.anthropic.claude-sonnet-5
aws_region_name: us-east-1
# Enable WebSearch interception for providers
litellm_settings:
callbacks: ["websearch_interception"]
websearch_interception_params:
enabled_providers:
- bedrock
- azure
- vertex_ai
search_tool_name: perplexity-search # Optional: specific search tool
# Configure search provider
search_tools:
- search_tool_name: perplexity-search
litellm_params:
search_provider: perplexity
api_key: os.environ/PERPLEXITY_API_KEY
Quick Start
1. Configure LiteLLM Proxy
Create config.yaml:
config.yaml
model_list:
- model_name: bedrock-sonnet
litellm_params:
model: bedrock/us.anthropic.claude-sonnet-5
aws_region_name: us-east-1
litellm_settings:
callbacks: ["websearch_interception"]
websearch_interception_params:
enabled_providers: [bedrock]
search_tools:
- search_tool_name: perplexity-search
litellm_params:
search_provider: perplexity
api_key: os.environ/PERPLEXITY_API_KEY
To use Parallel Search instead, set PARALLEL_API_KEY and replace the litellm_settings and search_tools sections:
Parallel Search configuration
litellm_settings:
callbacks: ["websearch_interception"]
websearch_interception_params:
enabled_providers: [bedrock]
search_tool_name: parallel-search
search_tools:
- search_tool_name: parallel-search
litellm_params:
search_provider: parallel_ai
api_key: os.environ/PARALLEL_API_KEY
2. Start Proxy
Start LiteLLM Proxy
# For Parallel Search, export PARALLEL_API_KEY=your-key instead.
export PERPLEXITY_API_KEY=your-key
litellm --config config.yaml
3. Use with Claude Code
Configure Claude Code
export ANTHROPIC_BASE_URL=http://localhost:4000
export ANTHROPIC_API_KEY=sk-<your-api-key>
claude
Now use web search in Claude Code - it works with any provider!