Yesterday's Top Poster

Claude Code Max via AI Gateway, available now for Claude Code

  • Thread starter Thread starter Walter Korman, Jerilyn Zheng
  • Start date Start date
AI Gateway now supports the Claude Code Max subscription for the Claude Code CLI. This allows developers to use their existing subscription on Anthropic models with no additional cost while getting unified observability, usage tracking, and monitoring through Vercel’s platform.

Setup​


Set up your environment variables in your shell configuration file (~/.zshrc or ~/.bashrc)


Replace your-ai-gateway-api-key with your actual AI Gateway API key.

Start Claude Code​

Log in with your Claude subscription​


If you're not already logged in, Claude Code will prompt you to authenticate. Choose Option 1 - Claude account with subscription and log in with your Anthropic account.

If you encounter issues, try logging out with claude /logout and logging in again.

Your Claude Code requests now route through AI Gateway, giving you full visibility into usage patterns and costs while using your Max subscription. If your Claude Code Max subscription reaches its rate limit, requests will fall back to your AI Gateway credits. Additionally, if the Anthropic provider is unavailable, requests will also route through your AI Gateway credits as a fallback.

How it works​


When you configure Claude Code to use AI Gateway, Claude Code continues to authenticate with Anthropic. It sends its Authorization header and AI Gateway acts as either a passthrough proxy to Anthropic or, when it needs to fall back, a router to other providers.

Since the Authorization header is reserved for Claude subscription credentials, AI Gateway uses a separate header x-ai-gateway-api-key for its own authentication. This allows both auth mechanisms to coexist.

Read more about how to configure Claude Code Max with AI Gateway in the docs.


Read more

Continue reading...
 
Back
Top