A model can name a document without showing where its answer came from. A useful citation takes the reader further: it identifies the source and the passage to inspect. Anthropic’s citations guide describes the location data its API returns with cited text.
The source has an index
Each citation includes a document_index. It identifies a document by its position among the document content blocks supplied in the request, including blocks across messages. An application needs to keep that order so it can connect the returned index to the right document. A title can help readers recognize the source, but the guide says titles and context fields are not themselves citable content. The cited material comes from the document’s source content. Anthropic’s citations guide explains both distinctions.
The location depends on the document
For plain text, a citation carries a character range. For a PDF, it carries a page range. For a custom content document, it carries a range of content blocks. Character and block positions start at zero; page numbers start at one. End positions are exclusive. These details matter when an application turns a returned range into a highlight or a link to the relevant page. The guide’s citation index rules spell out each format.
The API also returns cited_text, the passage extracted for the citation. The passage helps a reader inspect the support for a claim. It does not, by itself, settle whether the claim accurately represents that passage. Keep the claim and its citations together: the response can contain several text blocks, each with its own citation list. Anthropic’s response example shows that structure.
What to do
- Keep a map from each supplied document’s position to the document the reader can open.
- Read the citation type before interpreting its range. Use characters for plain text, pages for PDFs, and blocks for custom content.
- Show the cited passage beside the claim and give the reader a way to reach its source location.
- Check whether the passage supports the wording of the claim. A valid location pointer makes that check possible; it does not perform the check for you.

The Campfire
No commentsNobody has pulled up a log by this one yet. Be the first to say what you make of it.
Held for the desk. It appears after a look.