docs(ai-gateway): document web search & grounding (OpenAI + Gemini)#158
Merged
Conversation
Add a "Web search & grounding" section covering both providers, since the tool, endpoint, and response shape differ: - OpenAI: /v1/responses with web_search_preview; output[] with web_search_call items + output_text annotations. Notes that the GA web_search tool routes but returns empty annotations through the gateway. - Gemini: /v1/chat/completions with google_search, non-streaming; grounding on choices[].message.grounding_metadata. Includes a privacy callout: web search sends the query outside the workspace's home region and compliance boundary.
anukiransolur
approved these changes
Jul 7, 2026
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
Adds a Web search & grounding section to the AI Gateway guide, documenting how to get web-grounded answers with citations through the gateway — for both providers, whose tool / endpoint / response shape differ.
What's documented
/v1/responseswithweb_search_preview; responseoutput[]carriesweb_search_callitems +output_text.annotations(url_citation). Notes that the GAweb_searchtool routes but currently returns empty annotations through the gateway, soweb_search_previewis the tool that returns citations today./v1/chat/completionswithgoogle_search, non-streaming (grounding is only on the final body, not SSE chunks); grounding onchoices[].message.grounding_metadata(webSearchQueries,groundingChunks[].web.{uri,title,domain}).Accuracy
Request/response shapes and the provider-specific caveats (
web_search_previewvs GAweb_search; Gemini non-streaming; endpoint asymmetry) were verified against a working reference implementation and its probe output, not assumed.Notes
docs/guides/ai-gateway.md).pnpm run fmtwas intentionally not run — with no oxfmt config it reformats the whole repo; kept the diff to this guide only, matching existing style.pnpm run lintpasses (the onesitemap.tswarning is pre-existing).