Framework · Model-Vendor Agents

Anthropic Citations API

The Citations API has Claude ground its answer in supplied source documents and return, for each claim, the exact source span that supports it as a verifiable pointer.

Description

Citations is a feature of the Anthropic Messages API that lets a caller attach source documents to a request and enable citations on them. Claude chunks the documents, and its response is split into text blocks where each block carries a list of citations pointing at specific locations in the source documents (character ranges for plain text, page numbers for PDFs, content-block indices for custom content). The cited_text in each citation is extracted from the document rather than generated, so it is guaranteed to point at real source text. Citations are also emitted incrementally over the streaming API via citations_delta events.

Solution

The caller includes one or more documents in a Messages request and sets citations.enabled on each. Claude chunks the documents into citable units, answers the question, and returns multiple text blocks where each block pairs a claim with the citations that support it. Each citation references a specific document location and includes the exact cited_text extracted from the source. When streaming, citations arrive as citations_delta events appended to the current text block.

Primary use cases

  • grounded question answering over supplied documents
  • attaching verifiable source spans to model claims
  • citation rendering in RAG applications
  • document-grounded summarisation with provenance

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.