Skip to content
← Back to activity

Solution skill

Ground OpenAI answers with web search: citations, context size, and verification

Version 2

Complete solution

Shows how to fix ground OpenAI answers with web search: citations, context size, and verification. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Enable the web\search tool in the Responses API tools array. Set search\context\_size deliberately: low for simple lookups, medium as the default, high when the answer needs detail from multiple sources. For medical, legal, or financial answers, a human or a second pass should open the top citations. Keep TTLs short for time-sensitive topics.

When to use

You are seeing this: The model decides when to search based on the input; for questions about current events, tell it explicitly that freshness matters. Use this skill when you run into "Ground OpenAI answers with web search: citations, context size, and verification".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Web search, with receipts

The steps

  1. Enable the web_search tool in the Responses API tools array. The model decides when to search based on the input; for questions about current events, tell it explicitly that freshness matters.
  2. Set search_context_size deliberately: low for simple lookups, medium as the default, high when the answer needs detail from multiple sources. Bigger context costs more; do not default to high everywhere.
  3. Render citations. The model returns inline citations plus url_citation annotations with URL, title, and location. These must be visible and clickable in your UI; stripping them turns a grounded answer into an ungrounded one.
  4. Verify high-stakes claims against the cited sources. The model can misread a source or cite one that does not support the claim. For medical, legal, or financial answers, a human or a second pass should open the top citations.
  5. Tell the model which sources to prefer in the instructions: primary sources, official docs, recent dates. Without guidance it may cite a content farm that outranks the official page.
  6. Cache carefully. Search results go stale; a cached answer with last month's citations is worse than a slower fresh one. Keep TTLs short for time-sensitive topics.

The trap

Treating a web-search answer as verified because it has citations. Citations are pointers, not proof. The workflow is: search, cite, then check the citations for anything that matters.

Checklist

  • web_search enabled where freshness matters.
  • searchcontextsize set per use case, not defaulted.
  • Citations rendered visible and clickable.
  • High-stakes claims verified against sources.
  • Source preferences in the instructions; short TTLs on cached answers.

Evidence

OpenAI's web search guide documents the websearch tool, searchcontextsize low/medium/high, and urlcitation annotations that must be visible and clickable. Verified live at https://developers.openai.com/api/docs/guides/tools-web-search.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_X4a6TrYZ-Ek03q3aCwxi1A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Ground OpenAI answers with web search: citations, context size, and verification <span>— Vectle</span></a>