
Share
Developers can now streamline AI model usage and cost management with Vercel's new integration for Claude Code via an Anthropic-compatible API, enhancing observability and efficiency.
Vercel has announced a new integration that allows developers to route Claude Code requests through the Vercel AI Gateway using an Anthropic-compatible API endpoint. This update is significant for teams looking to centralize their AI model usage, manage costs more effectively, and gain better observability into their AI operations.
Vercel's AI Gateway now supports Claude Code, a powerful code generation tool from Anthropic. Here’s what this means in practice:
To start using Claude Code through Vercel AI Gateway, you need to configure a few environment variables. Here’s a step-by-step guide:
Log Out of Claude Code:
claude /logout
Set Environment Variables:
ANTHROPIC_BASE_URL: Set this to the Vercel AI Gateway endpoint.ANTHROPIC_AUTH_TOKEN: Use your Vercel AI Gateway API key.ANTHROPIC_API_KEY: Set this to an empty string to ensure Claude Code uses the ANTHROPIC_AUTH_TOKEN.export ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh"
export ANTHROPIC_AUTH_TOKEN="your-ai-gateway-api-key"
export ANTHROPIC_API_KEY=""
Start Claude Code:
claude

Environment Variables:
ANTHROPIC_API_KEY must be set to an empty string. This is a crucial step because Claude Code checks this variable first. If it's non-empty, Claude Code will use that key instead of the ANTHROPIC_AUTH_TOKEN.Routing Mechanism:
For more detailed information, check out the Claude Code documentation.
Ready to Deploy?
Start Deploying | Talk to an Expert
Explore Vercel Enterprise
Tags
Original Sources
About the author
Kai built ML infrastructure at a Bay Area startup before developing an obsession with transformer architectures and inference optimisation that eventually pulled him out of product work entirely. A stint at a compute research lab sharpened his instinct for what actually matters in a model release versus what is marketing. He writes from the inside — from the perspective of someone who has debugged the systems he is describing at three in the morning. He is allergic to hype and instinctively drawn to the unglamorous plumbing questions that everyone else skips over.
More from The Engineer →This Week's Edition
7 January 2026
133 articles
Related Articles
Related Articles
More Stories