[AI Gateway] Use gateway token for Claude Code; add Bedrock and Vertex docs#31681
[AI Gateway] Use gateway token for Claude Code; add Bedrock and Vertex docs#31681adriandlam wants to merge 2 commits into
Conversation
Review
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Warnings (2)
Style Guide Review✅ No style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
There was a problem hiding this comment.
Pull request overview
Updates the AI Gateway “Claude Code” integration guide to route requests through AI Gateway using gateway authentication, and expands the page with setup instructions for routing Claude Code via Amazon Bedrock and Google Vertex AI provider endpoints.
Changes:
- Updates the Anthropic setup commands to use the AI Gateway token in
ANTHROPIC_API_KEYand thecf-aig-authorizationheader. - Adds a new “Use Amazon Bedrock” section with OS-specific environment variable setup.
- Adds a new “Use Google Vertex AI” section with OS-specific environment variable setup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/bonk review this |
There was a problem hiding this comment.
This is a useful expansion — adding Bedrock and Vertex paths gives readers more flexibility.
However, the Anthropic section now has significant internal inconsistencies. The code sets ANTHROPIC_API_KEY to the gateway token, but the frontmatter description (line 3), introduction (line 13), prerequisites (line 21), and note (lines 24-26) still describe the old flow where the user provides their own Anthropic API key and Anthropic bills them directly. The note even says 'This configuration does not use BYOK' and 'Anthropic bills you for model usage' — neither of which matches the new token-only setup.
Please either:
- Update the surrounding text to match the new code (remove the Anthropic API key prerequisite, rewrite the note to explain how gateway auth works, and update the description/intro), OR
- Revert
ANTHROPIC_API_KEYto the user's Anthropic API key and keep the gateway token only inANTHROPIC_CUSTOM_HEADERSif that was not the intended change.
Also, the Bedrock base URL examples are missing the trailing slash after <AWS_REGION>. The AI Gateway Bedrock docs show the URL ending with .../bedrock-runtime/<AWS_REGION>/, and omitting the slash can cause path-joining issues.
|
Done! I submitted a review on PR #31681. Key findings:
|
|
ty @superhighfives! addressed all comments :) |
Summary
Updates the Claude Code setup guide (AI Gateway → Integrations → Coding agents) to authenticate with
the Cloudflare AI Gateway token instead of an Anthropic API key, and adds Amazon Bedrock and Google
Vertex AI setup paths to the same page.
integrations/coding-agents/claude-code.mdxANTHROPIC_API_KEYfor the gateway token; add Bedrock + Vertex sectionsWhat changed
ANTHROPIC_API_KEYnow holds the Cloudflare gateway token (<CF_AIG_TOKEN>)rather than an Anthropic API key
CLAUDE_CODE_USE_BEDROCK,ANTHROPIC_BEDROCK_BASE_URL, andCLAUDE_CODE_SKIP_BEDROCK_AUTH. The gateway signs requests with the AWS credentials stored via BYOKCLAUDE_CODE_USE_VERTEX,ANTHROPIC_VERTEX_BASE_URL,ANTHROPIC_VERTEX_PROJECT_ID,CLOUD_ML_REGION,and
CLAUDE_CODE_SKIP_VERTEX_AUTH. The gateway injects the Google Cloud credentials stored via BYOKNotes
Anthropic section.
Documentation checklist
incorrect or out of date information that this PR fixes.