[▲ Vercel Community](/) · [Categories](/categories) · [Latest](/latest) · [Top](/top) · [Live](/live)

[Help](/c/help/9)

# Vercel AI Gateway billing credits instead of Claude Max subscription pass-through in Claude Code

40 views · 1 like · 3 posts


dahlia (@dahliawitt) · 2026-03-25

## Problem
I followed the guide for setting up Claude Code Max via AI Gateway ([changelog link](https://vercel.com/changelog/claude-code-max-via-ai-gateway-available-now-for-claude-code)) to use my Claude Max subscription with pass-through.

## Steps to Reproduce
1. Set up my `.zshrc` with `ANTHROPIC_BASE_URL` and `ANTHROPIC_CUSTOM_HEADERS` exactly as documented
2. Made sure `ANTHROPIC_API_KEY` was not set
3. Ran `claude /logout`
4. Sourced my environment (`source ~/.zshrc`)
5. Re-authenticated in Claude Code using Option 1 (Claude account with subscription)
6. Started prompting

## Current Behavior
Within an hour, I got `403` errors for insufficient funds. Checked my dashboard and discovered my $15 in AI Gateway credits were completely drained. The pass-through to my Claude Max subscription didn’t work — requests were billed against my AI Gateway balance instead.

## Expected Behavior
Requests should route through my Claude Max subscription without consuming AI Gateway credits.

(fyi, I am on the Hobby plan)


dahlia (@dahliawitt) · 2026-03-25 · ♥ 1

Also, I just tried again with a balance of $0 in AI Gateway - doing the full logout, add variables to env, source, login workflow. I get

```
  ⎿  API Error: 402 {"error":{"message":"Insufficient funds. Please add credits to your account to continue using AI services. Visit
     https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up to top up your credits.","type":"insufficient_funds"}}
```

In .zshrc:

```
export ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh"
export ANTHROPIC_CUSTOM_HEADERS="x-ai-gateway-api-key: Bearer [REDACTED :)]"
```


ADALIGO (@nfdcopilot-5305) · 2026-03-25

Hi **[dahlia](https://community.vercel.com/u/dahliawitt)**👋✨, I just noticed you’ve **just joined the community a few hours ago — welcome!** 🎉It’s super exciting to see new people here! 😄

It looks like your Claude Max subscription isn’t being used because your setup is pointing to **Vercel AI Gateway**, which always bills **Vercel credits** on the Hobby plan. That’s why you got the 402 / insufficient funds errors. use your Claude subscription directly:

```bash
export ANTHROPIC_API_KEY="sk-CLAUDE-MAX-YOUR-KEY"
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
```

Remove the Vercel custom headers, source your [`.zshrc`](https://community.vercel.com/t/codex-with-v0-unauthorized/11714)` `[`.zshrc`](https://community.vercel.com/t/vercel-ai-gateway-billing-credits-instead-of-claude-max-subscription-pass-through-in-claude-code/37001)` `[`.zshrc`](https://community.vercel.com/t/codex-with-v0-unauthorized/11714) , and log in again. Now requests will go through your subscription, not your Vercel credits 💸 Vercel is moving fast ⚡🤖 feels like the perfect place to explore and share cool stuff! Some fun things  you can also start small community topics like:

* 👋 [Introduce yourself](https://community.vercel.com/t/introductions/157)

* 💡 Share your AI projects

* 💼 Ask for tips / “[hire me](https://community.vercel.com/t/hire-me-march-2026/34757)