Skip to content
eWiki The practical AI reference

AI Tool Glossary

What Are Document Citations in the Claude API?

Overhead view of a white desk with a grid of small paper cards marked by blue accents, surrounded by larger sheets, a black ruler, and a gray object.

Claude document citations are structured references that connect text in a Claude API response to supporting locations in supplied PDF, plain-text, or custom-content documents.

What Claude Document Citations Are

Claude document citations help applications ground answers in documents supplied through the Messages API. Alongside response text, the API can return structured citation data identifying the source location that supports a statement. This gives an application the information needed to show users where an answer came from.

Anthropic presents built-in citations as an alternative to citation formats created solely through prompting. The built-in feature instead associates cited response text with structured references. Anthropic’s current platform documentation states that all active Claude models support citations.

Citations are generally available through the Anthropic API and Google Cloud Vertex AI. Anthropic also documented Amazon Bedrock availability as of June 30, 2025.

A small grid-lined card pinned with a blue pushpin and trailing blue string atop a thick stack of white paper, with a binder clip, ruler, and another paper stack nearby.

How to Enable Citations in the Messages API

To enable citations, include a supported document in a Messages API request and set citations.enabled to true for that document. Supported inputs include PDF, plain-text, and custom-content documents. The workflow does not require Anthropic-hosted file storage.

Configuration must be consistent within each request: citation-enabled documents cannot be mixed with documents that have citations disabled. If an application sends several documents together, enable citations for every one of them.

Choose the input type according to how the application needs to organize and display its sources. PDF inputs support page-based locations, plain text supports character ranges, and custom content preserves developer-supplied content blocks. The response can then be rendered with links, labels, or source panels appropriate to the returned location type. These presentation choices are application-level decisions rather than claims that every citation format behaves identically.

A seated person places a blue tab on a stack of printed pages at a desk with a black pen and small blank cards; binders and labeled storage drawers line the background.

Citation Locations, Token Handling, and Limitations

Citation locations depend on the document format. PDFs return page ranges, plain-text documents return character-index ranges, and custom-content documents return content-block index ranges. PDF page numbers are 1-indexed. Document, character, and custom-content block indices are 0-indexed, and documented end indices are exclusive. An interface must interpret these conventions correctly before highlighting or linking a passage.

The API divides PDF and plain-text content into sentences. It does not further chunk custom-content documents; their supplied blocks remain the citation units. Developers therefore have more direct control over citation boundaries when preparing custom content.

Only document text can be cited. Images—including images embedded in PDFs—cannot serve as cited content, so image-heavy documents may not provide traceable support for information conveyed only visually. A document’s title and context fields may be passed to the model, but those fields are not citable source content.

Enabling citations can slightly increase input-token use because of document chunking and additions to the system prompt. Anthropic says the feature uses standard token-based pricing. Returned cited_text is not counted as output tokens, nor is it counted as input when included again in later conversation turns.

Conclusion

Claude document citations fit applications that answer questions from supplied documents and need to expose the supporting passages behind those answers. They provide structured source locations without requiring a citation format to be produced only through prompt instructions.

Start by selecting PDF, plain text, or custom content based on the location format your interface can present. Enable citations consistently for every document in the Messages API request, then map the returned page, character, or content-block locations to clear source references for users.

Disclosures and limitations

  • This article was prepared with AI assistance using Anthropic documentation and an Anthropic cookbook example as source material.

Sources

Improve this guide

Report a problem or suggest the next question

Submissions enter a private editorial queue. They are reviewed and deduplicated before any public update or new page is created.