Skip to content

Conversation

@palashgo
Copy link
Contributor

@palashgo palashgo commented Dec 19, 2025

Summary

AI Gateway can be configured in a bunch of ways:

  • With different providers (OpenAI / Anthropic / etc.)
  • Different client SDKs (OpenAI JS, Vercel AI SDK, etc.)
  • How upstream vendor auth is handled (Unified Billing, key passed in, key stored in Cloudflare)
  • Whether you're on Workers or not (use binding or not)
  • Whether Gateway Auth is on or off

Right now it's pretty hard for folks to take the small sample snippets we have and adapt them to their exact combo. This PR tries a madlib style, natural language form that generates the right code snippet based on what you pick.

(Since Code component is server-rendered, the generator is put together with a bit of a hack to wire everything up.)

@github-actions github-actions bot added the product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ label Dec 19, 2025
@github-actions
Copy link
Contributor

This PR requires additional review attention because it affects the following areas:

Partials

This PR updates partial files, which are pieces of content used across multiple files in our Render component.

Copy link
Collaborator

@kodster28 kodster28 left a comment

Choose a reason for hiding this comment

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

Few things here:

  • we want to keep .tsx and .astro files in src/components/
  • Also, testing it out on a few of the samples and it doesn't seem to work correctly.
  • Generally -- and this is part of our ongoing code orange work -- we want to avoid react in the components that are used in our docs. Assuming that these can be built out more natively in either Astro-native language or in more vanilla JS.

@palashgo
Copy link
Contributor Author

palashgo commented Dec 19, 2025

Few things here:

  • we want to keep .tsx and .astro files in src/components/
  • Also, testing it out on a few of the samples and it doesn't seem to work correctly.
  • Generally -- and this is part of our ongoing code orange work -- we want to avoid react in the components that are used in our docs. Assuming that these can be built out more natively in either Astro-native language or in more vanilla JS.

I can change all the code to vanilla js and move it in src/components but can you tell me what's not working, these are the two examples I changed and every combination seemed to be working

https://palash-aig-examples-exp.preview.developers.cloudflare.com/ai-gateway/get-started/#example

https://palash-aig-examples-exp.preview.developers.cloudflare.com/ai-gateway/integrations/vercel-ai-sdk/#examples

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/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants