Skip to content

docs(ai-gateway): add Web Search page#31658

Open
superhighfives wants to merge 3 commits into
productionfrom
docs/ai-gateway-web-search
Open

docs(ai-gateway): add Web Search page#31658
superhighfives wants to merge 3 commits into
productionfrom
docs/ai-gateway-web-search

Conversation

@superhighfives

Copy link
Copy Markdown
Contributor

Summary

  • Add a new AI Gateway Web Search usage page documenting provider-native web search through AI Gateway.
  • Cover Anthropic, OpenAI Responses API, xAI Responses API, and Alibaba Qwen request shapes.
  • Clarify Perplexity and Parallel as search-first provider proxy routes rather than provider-agnostic SDK helper tools.
  • Add a REST API cross-link so readers can discover the Web Search page from the main AI Gateway REST API docs.

Notes

This page is grounded in the captured web search support matrix from cloudflare/aig/ai-gateway-infra!658 and the existing AI Gateway provider docs.

Validation

  • git diff --check upstream/production..HEAD
  • Verified internal AI Gateway links resolve to existing docs files.
  • Verified curl JSON payloads parse successfully.
  • Verified Workers AI binding examples include the required AI Gateway argument for third-party models.
  • Scanned for historical/change-narrative wording and comparison-site references; no hits.

Document the four provider surfaces that expose server-side web search
through AI Gateway today (Anthropic, OpenAI Responses, xAI Responses,
Alibaba DashScope), plus the search-first provider proxies for
Perplexity and Parallel.

Sourced from cloudflare/aig/ai-gateway-infra!658, which added Web
Search examples for 29 LLMs, and !652 which added the
claude-sonnet-4.6 example mirrored by !658. Tool shapes, model lists,
and "not currently supported" rationale are taken from those MR
captures.

Cross-link added from usage/rest-api.mdx just before the
"Specify a gateway" section.
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review

⏸️ Automatic reviews for this PR are paused.

This PR has already received 2 automatic reviews. To run another review, a codeowner can comment /review or /full-review. To permanently lift the limit for this PR, a codeowner can comment /ignore-review-limit.

Tip: Keep PRs in draft mode until they are ready for review — the bot skips draft PRs automatically.


✅ No issues found in commit 6a06071.

Code Review

This code review is in beta and may not always be helpful — use your judgment.

✅ No code review issues found.

Style Guide Review

✅ No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/ai-gateway/ @abhishekkankani, @palashgo, @thebongy, @roerohan, @kathayl, @mchenco, @zeke, @superhighfives, @adriandlam, @mattrothenberg, @ethulia, @aninibread, @kflansburg, @cloudflare/product-owners

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new AI Gateway “Web Search” usage page documenting provider-native web search support across multiple upstream APIs, and links to it from the main REST API documentation so readers can discover it.

Changes:

  • Introduces usage/web-search.mdx with provider-by-provider request shapes (Anthropic, OpenAI Responses, xAI Responses, Alibaba Qwen) and guidance for search-first providers (Perplexity, Parallel).
  • Adds a “Provider tools and web search” section to the REST API page linking to the new Web Search doc.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/content/docs/ai-gateway/usage/web-search.mdx New documentation page for enabling provider-native web search via AI Gateway endpoints and proxy routes.
src/content/docs/ai-gateway/usage/rest-api.mdx Adds a cross-link to the new Web Search page from the REST API docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/rest-api.mdx Outdated

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

5 style guide issues to address before merge.

  • MEDIUM web-search.mdx:4description exceeds 160 characters (posted suggestion).
  • MEDIUM web-search.mdx:61,107,150,194 — Workers env.AI.run examples must use TypeScriptExample instead of bare javascript fences.
  • LOW rest-api.mdx:220 and web-search.mdx:81,165,240,259 — Use "refer to" instead of "see" (posted suggestions).

Note: The PR description and commit message reference internal resources. For future PRs, avoid including internal MR references in this public repository.

Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/rest-api.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
@ask-bonk

ask-bonk Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review completed. I posted 7 inline review comments on PR #31658 with a mix of suggestions and style notes.

Verdict: 5 style guide issues to address before merge.

Issues found:

  • MEDIUM web-search.mdx:4description frontmatter is ~195 characters, exceeding the 160-character limit. I posted a shorter suggestion.
  • MEDIUM web-search.mdx:61,107,150,194 — The four Worker env.AI.run examples use bare javascript fences instead of the mandatory TypeScriptExample component. I noted this with instructions on how to fix it.
  • LOW rest-api.mdx:220 and web-search.mdx:81,165,240,259 — Five instances of "see" should use "refer to" per the terminology table. I posted suggestions for all of these.

Other notes:

  • The PR description and commit message reference internal resources (cloudflare/aig/ai-gateway-infra!658, !652). This is a public repo, so I flagged this as a reminder to avoid internal MR references in future PRs.
  • Labels (size/m, product:ai-gateway) were already applied appropriately. No label changes needed.
  • Internal links all have correct trailing slashes. No unescaped MDX characters detected. Code block languages are lowercase.

github run

Apply review feedback from copilot-pull-request-reviewer and ask-bonk[bot]:

- Trim frontmatter description to 148 chars (was ~194, exceeded 160-char limit)
- Remove 5 model IDs not present in src/content/catalog-models/:
  anthropic/claude-opus-4.1, openai/gpt-5-pro, openai/gpt-5.2,
  openai/gpt-5.2-pro, openai/o3-pro
- Wrap all 4 Workers AI binding examples in <TypeScriptExample> with ts
  code fences (matches worker-binding-methods.mdx convention); add
  TypeScriptExample import
- Replace 5 occurrences of 'see' with 'refer to' (Cloudflare style guide)
- Add catalog pointer to the new cross-link in rest-api.mdx
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
Comment thread src/content/docs/ai-gateway/usage/web-search.mdx Outdated
@adriandlam

Copy link
Copy Markdown
Contributor

Looks good! Left some nits :)

Address adriandlam's two suggestions on the Anthropic section by switching
British 'Summarise' to American 'Summarize'. Extend the spelling fix to the
other 6 example prompts in the file for doc-wide consistency.

Normalize the xAI section example prompts to ask about Cloudflare (matching
Anthropic / OpenAI / Alibaba sections) instead of asking Grok about xAI.

Copy link
Copy Markdown
Contributor Author

Thanks @adriandlam — both SummariseSummarize nits are fixed in e140b03, and I normalized the other 6 occurrences in the file at the same time for doc-wide consistency. Inline replies on both threads have the details.

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.