# Citation & grounding check

> A citation and grounding check ties a claim in the reply to a source you actually retrieved.

Checking that a claim in the reply is tied to a source you actually retrieved.

Track: Retrieval & Grounding
Access: free
Card: https://buildsparkai.com/citation-grounding
Plain text: https://buildsparkai.com/citation-grounding.md
Last checked: 2026-10-18

## What it is

Anthropic's citations guide says you enable citations on a document and the response can attach a citation to a claim. The guide says the API extracts cited_text from the document, and that those citations contain valid pointers to the documents you provided. That statement is Anthropic's. A pointer is not a grade of the answer. OpenAI's file search guide says the message can include file_citation annotations with a file id and a filename. The support-docs answer bot on this site asks for a citations array in JSON. Anthropic's guide says citations cannot be used together with structured outputs, and that the API returns a 400 error if you enable both. The picture shows a claim with its source, then the same shape with the wrong source. It does not call either API.

## Why it matters

**Cost.** Anthropic's guide says enabling citations adds some input tokens because of the prompt and the chunking, and that cited_text does not count toward output tokens. This card does not turn that into a dollar figure.

**Quality.** A file id lets you open the file. It does not prove the sentence is in the chunk. On the support-docs answer bot, the template copies a sentence from the cited chunk. A model can name an id and write a sentence that chunk does not contain.

**Risk.** If one request needs both a JSON schema and Anthropic citations, the guide says the API returns a 400. Pick one on that request. A citation of a chunk you did not retrieve fails the check, even when the pointer is well formed.

## Try today

Take one answer from the support-docs answer bot. Open the citation id. If the sentence is not in that chunk, the check fails.

## Common mistake

Showing the citation and skipping the open-the-chunk step. Anthropic's pointer statement is about the document you sent, not about a file the model named from memory.

## Self-check

The reply cites the hours chunk and says the refund window is 90 days. The hours chunk is about weekday hours. What failed?

The claim is not in the cited source

## Practice and deep

Coming soon. One support-bot answer, with the cited chunk opened and the sentence marked or marked missing.

Coming soon. How Anthropic attaches a citation to a document you sent, and how OpenAI's file search puts a file_citation on the message.

## Sources

- [Anthropic, Citations](https://platform.claude.com/docs/en/build-with-claude/citations)
- [OpenAI, File search](https://developers.openai.com/api/docs/guides/tools-file-search)

Opened 2026-10-18. Vendor docs. Anthropic's note that cited_text is omitted from output tokens, and that citations conflict with structured outputs, is quoted from that guide. This card does not add a rate.
