iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
The OpenAI Responses API exposes citation and source metadata differently for web search and file search. Web search puts URL citations on the generated message and can optionally return the search action’s source records; file search identifies cited files with a file ID and filename, while its retrieved result records must be requested separately. Treating these as separate output items and annotation types is the key to building a reliable citation display.
The field names below come from OpenAI’s current Web search guide and File search guide. Response schemas can evolve, so verify the guide and API reference for the SDK and API version you deploy.
What does the Responses API return?
A Responses API result is a list of output items, not one flat citation object. Tool-call records and the assistant’s generated message are separate items. A web-search response can therefore contain a web_search_call item describing the search action and a message item whose content includes URL-citation annotations. A file-search response can contain a file_search_call item and a message item with file-citation annotations.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteStart your parser by checking each output item’s type. Then handle the tool-call metadata and message annotations independently. This prevents a common error: looking for a URL or filename directly on the top-level response, or assuming every tool uses the same annotation schema.
Popular on Amazon
- 【90 Degree Full Function USB C Adapter】Supports the latest USB4 standard for up to 40Gbps of bandwidth, 8K video support, and up to 240W Fast charging; Support USB PD 3.1 Extended Power Range (EPR) including 140W, 180W and 240W. Your productivity is easily doubled. *Warm Tip: For the best fit, please make sure the USB-C port is fully exposed; thick or bulky cases may affect compatibility.
- 【Reliable Quality】Made from high-quality, scratch-resistant aluminum alloy, delicate metal frame. get excellent wear resistance and heat dissipation. Non-Slip Design for easier insertion and removal.
- 【Small and portable】Ultra thin size, ultra compact design, a petite physique that matches the minimalist design of your modern laptops. Coming with a slim figure that won't block the port next to the one it's plugged into.
- 【Compatibility】Widely work with most usb c, thunderbolt 4/3 devices. Compatibilit for ROG Ally, Steam Deck, Switch, MacBook Pro, Quest 3 VR headset, Surface Book 2, iPhone 18/17/16/15, Samsung Galaxy S23/S22/S21, Note 20/10, Google Pixel, ChromeBook, etc.
- 【Excellence Customer Support】If you experience any issues or cable failure, simply reach out to our dedicated customer service team. We provide a prompt response within 18 hours, providing you with the necessary technical support to resolve any concerns.
What citation fields does web search provide?
Web search citations are url_citation annotations attached to generated message content. The documented example includes the cited source’s URL and title plus start_index and end_index, which identify the span of generated text associated with that source. OpenAI’s Web search documentation says that, by default, the model response includes inline citations for URLs found in web-search results.
The fields have distinct jobs:
url: the web address of the cited source.title: the source title supplied with the citation.start_indexandend_index: character-position boundaries that let your application associate the annotation with the relevant part of the generated text.
The citation annotation is metadata; it is not necessarily a ready-made HTML link in the text string. A renderer can use the index range to add a clickable link, a footnote marker, or a source popover without guessing which sentence the source supports. Preserve the original URL and title when you render it. OpenAI’s guide also says interfaces that display web results or information from them must show prominent, clickable inline citations.
What is in a web_search_call item?
The web_search_call output item records the search tool invocation. The documented structure includes a call ID and an action. The action types described by the guide are search, open_page, and find_in_page. A search action will usually, but not always, include the queries that were searched.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
This record answers a different question from a url_citation: it tells you what the tool did, while the annotation tells you where the generated answer cites a source. Keep both when you need an audit trail. For example, a support dashboard might show the answer’s inline citations to a reader while storing the call ID, action type, and query information for debugging or provenance.
How do I retrieve web-search source records?
Inline URL annotations do not replace the search action’s source list. Request the source records explicitly with the Responses API request’s include parameter:
Also popular on Amazon
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
{
"include": ["web_search_call.action.sources"]
}
With that include path, the response exposes source records associated with the web-search action. The official example traverses the search call’s action and reads each source URL. Because the source list belongs to the tool-call action, inspect the web_search_call item rather than the message annotations when you need every source associated with the search operation.
A robust web-search pipeline commonly keeps three layers:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →- Generated text: the assistant message that the user reads.
- Inline annotations: each
url_citation, including its URL, title, and text-span indices. - Action sources: the records returned through
web_search_call.action.sources, when requested.
These layers can differ. A source may be available in the search action’s records without being cited in the final prose, while an annotation identifies the particular source the model connected to a text span. Do not assume that counting source records gives you the number of inline citations.
What citation fields does file search provide?
File search uses a different annotation type: file_citation. The documented annotation carries an index, a file_id, and a filename. The message text can therefore identify the uploaded file that supports a statement, but the example in OpenAI’s guide does not present a web-style URL or title for that citation.
Use the fields as follows:
index: the citation’s position or identifier in the generated message’s citation metadata.file_id: the identifier of the uploaded file used by the file-search system.filename: the human-readable file name shown with the citation.
If your product needs a download link, document page, or access-control label, maintain that mapping in your own application. Do not manufacture a URL from a filename, and do not assume that a file citation contains the same fields as a web citation.
Also popular on Amazon
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
How do I return file-search results?
File-search result records are not returned by default, even though the generated message may contain file citations. Ask for them with the include parameter:
{
"include": ["file_search_call.results"]
}
The file-search call example contains queries and a search_results field. Without the include option, the result field is null by default according to the guide. With file_search_call.results requested, your application can inspect the retrieved records in addition to the message’s file-citation annotations.
You can also set max_num_results to limit how many file-search results are returned. A smaller limit can reduce token use and latency, but the guide notes a possible cost to answer quality. Choose the limit based on how much evidence your answer needs, and record the value alongside the response if you need reproducible diagnostics.
What is the difference between web and file citations?
Both tools can provide evidence metadata, but they identify that evidence differently and expose retrieval details through different include paths.
| Aspect | Web search | File search |
|---|---|---|
| Message annotation | url_citation |
file_citation |
| Documented identifying fields | URL, title, start index, end index | Index, file ID, filename |
| Separate tool-call item | web_search_call with an action and ID |
file_search_call with an ID, queries, and a result field |
| Request for additional records | web_search_call.action.sources |
file_search_call.results |
| Default noted in the guide | Inline URL citations are included for URLs found in search results | Search-result records are not returned by default |
This is a comparison of the fields demonstrated in the reviewed official guides, not a claim that either tool’s schema is exhaustive. Keep parsing tolerant of additional fields and avoid rejecting a response just because it contains metadata not listed here.
Also popular on Amazon
- Portable and powerful USB-C HUB: BENFEI USB Type-C HUB, with super-soft and knot-free silicone woven design cable, meets most mobile office needs. Compact, lightweight, stylish, and powerful portable USB C Hub equipped with 1 x HDMI port, 1 x 100W charging, and 3 x USB ports. 18-month warranty, 24-hour response, to ensure you feel at ease when using our product.
- Design centered on comfort and reliability: Thanks to BENFEI's end-to-end in-house cable production capability, in-house PCBA and assembly capability, using the industry's most advanced silicone woven design and process, 20cm cable in length, no knots, super-soft, the HUB is easy to use in all scenarios: laptop, tablet, stand etc. Super-soft, 25000+ life cycles, to meet your daily carrying and office needs.
- 100W Charging: Support up to 90W USB C pass-through charging via Type-C port to keep your laptop powered. 10W is reserved for other interface operations. No data and video function on the Type-C port.
- 4K HDMI Display: The HDMI port supports media display at resolutions up to 4K 30Hz, keeping every incredible moment detailed and ultra vivid. Please note that the C port of the Host device needs to support video output.
- Transfer Files in Seconds: Transfer files and from your laptop at speeds up to 10 Gbps with USB A 3.2 port. Extra 2 USB A 2.0 ports are perfectly for your keyboards and mouse.
How should I build a citation renderer?
Build the renderer around the response’s actual item and annotation types rather than around a single “sources” array.
- Save the raw response. Retaining the original output makes it possible to diagnose missing annotations, changed fields, or rendering mistakes.
- Separate output items by type. Collect
web_search_call,file_search_call, and message items independently. - Extract message content and annotations. For web search, find
url_citationannotations; for file search, findfile_citationannotations. - Validate span boundaries before linking. Check that a web annotation’s start and end indices fall within the text you are displaying. If your renderer transforms whitespace or Markdown before applying links, apply the indices first or maintain an explicit offset map.
- Render safely. Escape titles and filenames as text, allow only approved URL schemes, and open external links according to your application’s security policy.
- Request retrieval records when needed. Add the appropriate
includepath only for workflows that need source or result details; do not infer those records from message annotations. - Keep provenance with the answer. Store the call ID, annotation data, and any returned source or result records together with the generated text.
For web search, the user-facing experience is usually an inline marker attached to the cited phrase, followed by the source title and URL in a tooltip or source list. For file search, show the filename and, where permitted by your authorization model, a link or preview generated from your own file metadata. The API’s file citation fields alone do not establish that a user may download the file.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What mistakes should I avoid?
Assuming every citation is a URL
That works for the documented web-search annotation, not for file search. A file citation identifies a file with an ID and filename; it does not promise a URL or page title.
Looking only at the message text
Tool-call records carry information that message annotations do not, including the web-search action and file-search queries. Parse every output item.
Expecting file results by default
File-search result records are omitted unless you request file_search_call.results. A valid file citation in the message does not prove that the full retrieved-result objects are present.
Also popular on Amazon
- 【Read before You Buy】 Note: This adapter is USB 2.0 version and cannot transmit HDM, VGA, or other video signals. Nevertheless, they are fully capable of charging devices,duplicating files, and can be seamlessly integrated with USB-C earphones, wireless network adapters, and SD card adapters.
- 【Easy to Use and Safe】Thanks to modern manufacturing techniques, we've made these adapters sufficiently compact so that they can remain inserted in your device without noticeable protrusion or inconvenience. This means you don't have to constantly plug and unplug them, reducing the likelihood of wear and misalignment, and making them more convenient to carry around.
- 【Reliable Quality】Engineered for enhanced durability, durable aluminum alloy shell material,get excellent wear resistance and heat dissipation,the male USB C and female USB connectors & the male USB and female USB C connectors are designed to be plugged and unplugged up to 20000 times. Provides data transfer, device charging, memory space expansion, and additional computer peripherals.
- 【Think more for you】Do you need to connect a USB-C-enabled device to an odd device that only has USB-A ports? Then these USB-A male to USB-C female adapters are made for you.Simply insert the adapter into the USB-A port on the device, and you can instantly connect your USB-C device to the device that originally didn't have the correct connection port.
- 【Trusted xiwxi Quality and Service】As a responsible brand seller, you will receive xiwxi's 12-month Quality assurance and lifetime friendly customer service, you're not just buying a product,you're investing in peace of mind with all-round quality and exceptional customer service.
Ignoring text offsets
Web citation indices are how you connect a citation to the statement it supports. Appending all links at the bottom without using those boundaries loses that association and can make the interface harder to audit.
Treating the guides as a complete universal schema
The reviewed documentation establishes these web-search and file-search cases. It does not enumerate every citation-like field across every Responses API tool and output type. Confirm any broader assumption against the API reference for the version you use.
What is the practical takeaway?
Use url_citation annotations and their URL, title, and text-span indices for web-search citations; use file_citation annotations and their index, file ID, and filename for file-search citations. Request web_search_call.action.sources when you need web-search source records, and request file_search_call.results when you need file-search result records. The safest implementation treats tool calls, generated text, annotations, and retrieved records as related but separate data.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
Can a file citation include a clickable URL like a web citation?
Not in the documented file-search annotation example. It identifies the file with a file ID and filename, so any download or preview URL must come from your application’s own file metadata and permission checks.
Will every web-search source appear as an inline citation?
Not necessarily. The guide documents inline citations for URLs found in search results, while the action’s source records are a separate collection. A source record and a cited text span should therefore be treated as different relationships.
Do I need to request both include paths in every response?
No. Use the web-search include path for web source records and the file-search include path for file results. Requesting only the metadata your interface needs can keep responses simpler, while file-search result limits can also affect latency and answer quality.
How can I preserve citations when formatting Markdown or HTML?
Apply web citation offsets to the original generated text before transformations that change character positions, or maintain an offset map through your formatter. Escaping, link insertion, and whitespace normalization can otherwise make start and end indices point to the wrong text.

