[AI Gateway] Document Bedrock API key auth for Unified API - #32693
Closed
superhighfives wants to merge 1 commit into
Closed
[AI Gateway] Document Bedrock API key auth for Unified API#32693superhighfives wants to merge 1 commit into
superhighfives wants to merge 1 commit into
Conversation
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
superhighfives
marked this pull request as ready for review
August 12, 2026 17:48
superhighfives
requested review from
a team,
aninibread,
ethulia,
kathayl,
kflansburg,
mattrothenberg,
mchenco,
palashgo,
roerohan and
zeke
as code owners
August 12, 2026 17:48
Contributor
Review
👉 Fix in your agent 👈Fix the following review findings in PR #32693 (https://github.com/cloudflare/cloudflare-docs/pull/32693).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.
The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.
---
## Code Review
### Warnings (1)
#### CR-3a82d26193fb · Missing gateway authentication in provider-key SDK example
- **File:** `src/content/docs/ai-gateway/usage/providers/bedrock.mdx` line 246
- **Issue:** The new Bedrock API key OpenAI SDK snippet sets `apiKey: "{BEDROCK_API_KEY}"`, which sends the Bedrock token in the `Authorization` header. It does not show how to also send `cf-aig-authorization: Bearer {CF_AIG_TOKEN}`, so users with authenticated gateways will get a 401.
- **Fix:** Add `defaultHeaders: { "cf-aig-authorization": "Bearer {CF_AIG_TOKEN}" }` and note that it is only needed for authenticated gateways, or use Details/Tabs for authenticated vs. unauthenticated variants like the OpenAI provider page.
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Warnings (1)
ConventionsNo convention issues found. Style Guide ReviewNo style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
Contributor
|
Preview URL: https://f2c9404a.preview.developers.cloudflare.com Files with changes (up to 15) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents a new authentication option for Amazon Bedrock on the Unified API (
/compat/chat/completions): a plain Bedrock API key (bearer token). Previously the compat path required BYOK SigV4 credentials with an explicitregionand rejected bearer-only requests, so a Bedrock API key never worked there. AI Gateway now defaults the region tous-east-1for the bearer path, so key-only Bedrock compat works out of the box. SigV4 BYOK is unchanged and still requires an explicit region.Adds an Authentication subsection contrasting BYOK (SigV4) vs. Bedrock API key auth, plus an OpenAI SDK example using a Bedrock API key and a note on targeting other regions via BYOK.
Documentation checklist