Enable routing to Vercel for Anthropic models#641
Conversation
| extraHeaders['x-anthropic-beta'] = [extraHeaders['x-anthropic-beta'], betaFlag] | ||
| .filter(Boolean) | ||
| .join(','); | ||
| for (const header of ['anthropic-beta', 'x-anthropic-beta']) { |
There was a problem hiding this comment.
[WARNING]: Behavioral change — both anthropic-beta and x-anthropic-beta are now set for all gateways.
Previously only x-anthropic-beta was sent (used by OpenRouter). Now anthropic-beta is also sent to OpenRouter, and x-anthropic-beta is sent to Vercel. While likely harmless (gateways should ignore unrecognized headers), this is a subtle change worth being aware of — if either gateway treats the unexpected header variant as an error or processes it differently, it could cause issues.
Also, the old Vercel-specific code in applyVercelSettings added context-1m-2025-08-07 to the anthropic-beta header for Anthropic models routed through Vercel. That beta flag is now dropped entirely. If 1M context support on Vercel still requires this beta flag, this is a regression. If it's now GA, this is fine.
There was a problem hiding this comment.
- I think that's fine
- It's enabled automatically now: https://vercel.com/docs/ai-gateway/models-and-providers/model-variants#anthropic-claude-sonnet-4-and-4.5:-1m-token-context
Code Review SummaryStatus: 1 Issue Found | Recommendation: Verify before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (2 files)
|
No description provided.