Skip to content

docs(ai-gateway): document web search & grounding (OpenAI + Gemini)#158

Merged
anukiransolur merged 1 commit into
mainfrom
docs/aigateway-web-search
Jul 7, 2026
Merged

docs(ai-gateway): document web search & grounding (OpenAI + Gemini)#158
anukiransolur merged 1 commit into
mainfrom
docs/aigateway-web-search

Conversation

@dragon3

@dragon3 dragon3 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

  • OpenAI/v1/responses with web_search_preview; response output[] carries web_search_call items + output_text.annotations (url_citation). Notes that the GA web_search tool routes but currently returns empty annotations through the gateway, so web_search_preview is the tool that returns citations today.
  • Gemini/v1/chat/completions with google_search, non-streaming (grounding is only on the final body, not SSE chunks); grounding on choices[].message.grounding_metadata (webSearchQueries, groundingChunks[].web.{uri,title,domain}).
  • Privacy callout — enabling web search sends the query and request context to an external provider (Bing / Google Search), outside the workspace's home region and compliance boundary.

Accuracy

Request/response shapes and the provider-specific caveats (web_search_preview vs GA web_search; Gemini non-streaming; endpoint asymmetry) were verified against a working reference implementation and its probe output, not assumed.

Notes

  • Single-file change (docs/guides/ai-gateway.md). pnpm run fmt was intentionally not run — with no oxfmt config it reformats the whole repo; kept the diff to this guide only, matching existing style.
  • pnpm run lint passes (the one sitemap.ts warning is pre-existing).

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.
@dragon3
dragon3 requested a review from a team as a code owner July 7, 2026 05:15
@dragon3 dragon3 self-assigned this Jul 7, 2026
@anukiransolur
anukiransolur merged commit 83baac0 into main Jul 7, 2026
3 checks passed
@anukiransolur
anukiransolur deleted the docs/aigateway-web-search branch July 7, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants