-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Update authorization header and clarify API usage #22847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a6003a4
223bb47
b6bba4d
edc7645
50e6782
52b5ce0
00b24ec
869e11e
caafc80
1e83adf
2d7bf94
1890399
ad59db0
4553df0
4f2f727
8995e45
b46d74c
bec2956
273f1b0
aa56813
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ Alternatively, you can use the command line as shown below to create a new MCP S | |
|
|
||
| <PackageManagers | ||
| type="create" | ||
| pkg="cloudflare@latest" | ||
| pkg="Cloudflare@latest" | ||
| args={"my-mcp-server --template=cloudflare/ai/demos/remote-mcp-authless"} | ||
| /> | ||
|
|
||
|
|
@@ -118,7 +118,7 @@ Run the following command to create a new MCP server: | |
|
|
||
| <PackageManagers | ||
| type="create" | ||
| pkg="cloudflare@latest" | ||
| pkg="Cloudflare@latest" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The package name should remain lowercase as |
||
| args={ | ||
| "my-mcp-server-github-auth --template=cloudflare/ai/demos/remote-mcp-github-oauth" | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -64,7 +64,7 @@ curl -X POST https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/comp | |||||
|
|
||||||
| ### Universal provider | ||||||
|
|
||||||
| You can also use this pattern with the [Universal Endpoint](/ai-gateway/universal/) to add [fallbacks](/ai-gateway/configuration/fallbacks/) across multiple providers. When used in combination, every request will return the same standardized format, whether from the primary or fallback model. This behavior means that you do not have to add extra parsing logic to your app. | ||||||
| You can also use this pattern with the [Universal Endpoint](/ai-gateway/universal/) to add [fallbacks](/ai-gateway/configuration/fallbacks/) across multiple providers. When used in combination, every request will return the same standardized format, whether from the primary or fallback model. This behavior means that you do not have to add extra parsing logic to your app. | ||||||
|
|
||||||
| ```ts title="index.ts" | ||||||
| export interface Env { | ||||||
|
|
@@ -77,7 +77,7 @@ export default { | |||||
| provider: "compat", | ||||||
| endpoint: "chat/completions", | ||||||
| headers: { | ||||||
| authorization: "Bearer ", | ||||||
| authorization: "Bearer", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The authorization header should include a space after 'Bearer'. According to OAuth 2.0 standards, the format should be 'Bearer {token}' with a space between 'Bearer' and the token value.
Suggested change
|
||||||
| }, | ||||||
| query: { | ||||||
| model: "google-ai-studio/gemini-2.0-flash", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package name should remain lowercase as
cloudflare@latest. The npm package is published as lowercase 'cloudflare' (https://www.npmjs.com/package/cloudflare), and changing it to uppercase 'Cloudflare' would cause the package manager commands to fail.