Rendered Source Note

Anthropic Citations (Messages API)

Generated HTML view. Markdown remains canonical.

Anthropic Citations (Messages API)

Type: official documentation Tier: 1 (Official Docs) Author(s): Anthropic Date: accessed 2026-06-01 URL: https://docs.anthropic.com/en/docs/build-with-claude/citations Accessed: 2026-06-01

Why This Source Matters

RAG's promise is not just "answer from documents" but "answer from documents and show me where." Project 04 builds a citation system that traces each claim back to the source passage. This doc is the primary source for how a production API does exactly that — mapping spans of the answer to exact character/page/block locations in the source documents — and is the model for the (provider-agnostic) citation contract the learner builds. It grounds the lesson's citations section and the "answers must be verifiable" stake.

Key Claims

What citations do

How it works (three steps)

  1. Provide documents, enable citations. Attach documents (plain text, PDF, or custom content) with citations.enabled = true.
  2. Documents get chunked. "Document contents are 'chunked' in order to define the minimum granularity of possible citations." Plain text and PDFs are "chunked into sentences"; custom content blocks "are used as-is and no further chunking is done." (Note: the citation granularity is sentence-level chunking — distinct from, but conceptually the same operation as, the retrieval chunking in sources/articles/chunking-strategies.md.)
  3. Claude returns a cited response. Answer is split into multiple text blocks; cited blocks carry a citations list pointing into the source.

Citation format — answer span → source location

Citable vs. non-citable content

Why the feature beats prompt-only "please quote the source"

Relevant To

Notes