Skip to content

Conversation

@daisyfaithauma
Copy link
Contributor

Summary

Screenshots (optional)

Documentation checklist

  • The documentation style guide has been adhered to.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

@hyperlint-ai
Copy link
Contributor

hyperlint-ai bot commented May 7, 2025

Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment.

We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.


PR Change Summary

Added documentation for the Chat Completion Endpoint and enhanced the Browser Rendering section with new examples.

  • Introduced a new page for the Chat Completion Endpoint with usage details and examples.
  • Updated the Browser Rendering documentation to include new examples for the Workers Binding API and REST API.
  • Added a new guide for extracting blog post content using the markdown endpoint.

Modified Files

  • src/content/docs/browser-rendering/get-started.mdx

Added Files

  • src/content/docs/ai-gateway/chat-completion.mdx
  • src/content/docs/browser-rendering/how-to/markdown-extraction.mdx

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@github-actions github-actions bot added product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ product:browser-rendering labels May 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2025

Preview URL: https://89fdc6e6.preview.developers.cloudflare.com
Preview Branch URL: https://chat-completions.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/ai-gateway/chat-completion/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/chat-completion/
https://developers.cloudflare.com/ai-gateway/providers/grok/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/grok/
https://developers.cloudflare.com/ai-gateway/providers/anthropic/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/anthropic/
https://developers.cloudflare.com/ai-gateway/providers/cerebras/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/cerebras/
https://developers.cloudflare.com/ai-gateway/providers/cohere/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/cohere/
https://developers.cloudflare.com/ai-gateway/providers/deepseek/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/deepseek/
https://developers.cloudflare.com/ai-gateway/providers/google-ai-studio/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/google-ai-studio/
https://developers.cloudflare.com/ai-gateway/providers/groq/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/groq/
https://developers.cloudflare.com/ai-gateway/providers/mistral/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/mistral/
https://developers.cloudflare.com/ai-gateway/providers/perplexity/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/perplexity/
https://developers.cloudflare.com/ai-gateway/providers/workersai/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/workersai/
https://developers.cloudflare.com/ai-gateway/configuration/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/configuration/
https://developers.cloudflare.com/ai-gateway/providers/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/providers/
https://developers.cloudflare.com/ai-gateway/websockets-api/ https://chat-completions.preview.developers.cloudflare.com/ai-gateway/websockets-api/

@daisyfaithauma daisyfaithauma marked this pull request as ready for review May 8, 2025 13:36
@daisyfaithauma daisyfaithauma requested review from a team, kathayl and mchenco as code owners May 8, 2025 13:36
@github-actions github-actions bot removed product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ product:vectorize Vectorize: https://developers.cloudflare.com/vectorize/ product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ product:developer-spotlight product:aegis product:workflows Workflows: https://developers.cloudflare.com/workflows/ product:AutoRAG product:security product:google-tag-gateway product:cloudflare-challenges labels May 13, 2025
@G4brym
Copy link
Member

G4brym commented May 27, 2025

the side menu for openai compat should be at least be bellow the model providers, but in my opinion should be right bellow the universal endpoint

image

@G4brym
Copy link
Member

G4brym commented May 27, 2025

in the examples, for openai compat should contain an example using the universal endpoint

		return env.AI.gateway('my-gateway').run({
			provider: "compat",
			endpoint: "chat/completions",
			headers: {
				authorization: "Bearer my-api-token",
			},
			query: {
                            "model": "google-ai-studio/gemini-2.0-flash",
                            "messages": [
                              {
                                "role": "user",
                                "content": "What is Cloudflare?"
                              }
                            ]
			},
		});

image

Copy link
Member

@G4brym G4brym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please solve the missing example and the sidebar priority issue before merging

@kathayl
Copy link
Contributor

kathayl commented May 27, 2025

  1. Examples can be its own section with each different example as a lower level importance
image

three examples: openai sdk, curl, universal (gabriel's comment)

@kathayl
Copy link
Contributor

kathayl commented May 27, 2025

  1. what is the best way to refer to curl examples?
    In the provider specific docs (openai, anthropic, etc.) we show as cURL
image

then in the new openai compat doc we show as curl but with grey box
image

@kathayl
Copy link
Contributor

kathayl commented May 28, 2025

  1. change location of page to underneath "model providers"

@kodster28
Copy link
Collaborator

@kathayl, addressed your feedback.

@G4brym, messaged you two questions on the new example you provided.

@kodster28 kodster28 requested a review from G4brym May 28, 2025 16:36
@kathayl kathayl merged commit c048e88 into production May 28, 2025
11 checks passed
@kathayl kathayl deleted the chat-completions branch May 28, 2025 19:49
sdnts pushed a commit to sdnts/cloudflare-docs that referenced this pull request Jul 24, 2025
* initial rest API guide

* Initial documentation for chat completions

* Revert "initial rest API guide"

This reverts commit 2a091c4.

* renamed

* partial-test

* added partial

* minor edit

* Partial fixes

* Add Universal endpoint

* updated content type

---------

Co-authored-by: kodster28 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants