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

**Published:** January 26, 2026 | **Authors:** Walter Korman, Jerilyn Zheng

---

[AI Gateway](https://vercel.com/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`)

```bash
export ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh"
export ANTHROPIC_CUSTOM_HEADERS="x-ai-gateway-api-key: Bearer your-ai-gateway-api-key"
```

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

### Start Claude Code

```bash
claude
```

### 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.

### 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](https://vercel.com/docs/ai-gateway/coding-agents/claude-code#with-claude-code-max).

---

📚 **More updates:** [View all changelog entries](/changelog/sitemap.md) | [Blog](/blog/sitemap.md)