[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Document-Grounded Citations

📎 Citations & Files API20 min550 BASE XP

Precision Source Attribution

The Citations API (anthropic-beta: citations-2025-02-28) enables Claude to ground its responses in specific passages from provided documents. When enabled, every claim in Claude's response includes a reference to the exact sentence, paragraph, or page it was derived from - dramatically reducing hallucination risk.

Citation Types

TypeGranularityBest For
char_locationCharacter-level offsetPlain text documents
page_locationPage number + bounding boxPDF documents
content_block_locationBlock index referenceStructured content arrays

Enabling Citations

const response = await anthropic.messages.create({
  model: "claude-3-7-sonnet-20250219",
  max_tokens: 4096,
  citations: { enabled: true },
  messages: [{
    role: "user",
    content: [
      { type: "document", source: { type: "base64", media_type: "application/pdf", data: pdfBase64 }, title: "Contract.pdf" },
      { type: "text", text: "Summarize the key obligations in this contract with citations." }
    ]
  }]
});
SYNAPSE VERIFICATION
QUERY 1 // 1
What is the primary benefit of the Citations API?
Faster generation speed
Grounding claims with verifiable source references to reduce hallucination
Lower token usage
Automatic translation