Skip to main content
Route Claude Code through Amazon Bedrock via Portkey. Get full observability, cost tracking, budget controls, and cross-region inference support. See Claude Code overview for why platform teams use Portkey.
Important: Always use the latest version of Claude Code. Older versions may not work with Portkey’s gateway.

Quick Start

1

Create a Virtual Key

Go to Virtual Keys → Create → Select Amazon Bedrock.Enter your AWS credentials:
  • AWS Access Key ID
  • AWS Secret Access Key
  • AWS Region (e.g., us-east-1)
Save and copy the virtual key ID.
2

Get Your Portkey API Key

Go to API Keys → Generate a new key.
3

Configure Claude Code

Edit ~/.claude/settings.json (user-level) or .claude/settings.json (project-level):
Replace:
  • YOUR_PORTKEY_API_KEY with your Portkey API key
  • YOUR_VIRTUAL_KEY with your virtual key ID
Model names are required. Bedrock uses different model IDs than Anthropic Direct API. Without these settings, requests will fail.
Cross-region inference: The us. prefix enables cross-region inference, routing requests to the nearest available region. Remove the prefix to use a specific region.
The CLAUDE_CODE_SKIP_BEDROCK_AUTH and CLAUDE_CODE_USE_BEDROCK must be set as numbers (not strings).
That’s it! All Claude Code requests now route through Bedrock via Portkey. Monitor usage in the Portkey Dashboard.

Using a Config

For advanced features like fallbacks, caching, or retries, create a Portkey Config:
1

Create a Config

Go to Configs → Create Config:
Save and copy the Config ID.
2

Update Claude Code Settings

Add the config to your settings:

Adding Metadata

Track Claude Code usage by team, project, or user:

Advanced Configuration

Fallbacks

Route to backup providers when Bedrock fails. Create a config with fallback targets:

Load Balancing

Distribute requests across multiple providers or regions:

Caching

Reduce costs and latency for repeated queries:

Retries

Automatically retry failed requests:

Budget Limits

Set spending controls on your virtual key:
  1. Go to Virtual Keys → Select your Bedrock virtual key
  2. Click Edit → Budget & Limits
  3. Configure:
    • Cost limit: Maximum spend (e.g., $500/month)
    • Rate limit: Requests per minute/hour
Budget limits prevent runaway costs from agentic coding sessions.

Troubleshooting

Claude Code Version Issues

Cause: Older versions of Claude Code may not be compatible. Fix: Update to the latest version:
Or reinstall:

Complete Example

Full configuration with all features enabled:
With Portkey Config:

Next Steps

Access Controls

Set up fine-grained permissions and audit logging

Budget Management

Prevent overspending with hard budget limits
Last modified on April 8, 2026