problem description
Noticed this week that I was getting charged for usage for what was normally my subscription usage. This led to a two week spend of about $1200. I added some additional headers for attribution, which I supposed triggered this.
here’s my configuration before I reverted it:
ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh" \
ANTHROPIC_CUSTOM_HEADERS=$'x-ai-gateway-api-key: Bearer AI_GATEWAY_KEY\nhttp_referer: REFERER\nx-title: NAME' \
claude
The current behavior isn’t documented behavior so I thought I would flag this. Adding additional headers should either be documented that it will cost usage or it shouldn’t cost additional usage.
how to reproduce
run ai gateway with headers from above. notice how ai gateway reverts to api usage instead of using claude subscription.
other thoughts
given the current gatekeeping with claude, do we expect any interruption in this service with vercel ai gateway where we will get billed api usage without warning if we continue to use ai gateway to proxy claude requests? (i love ai gateway, but i don’t love surprise charges :P)