[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Document-Grounded Citations

📎 Citations & Files API20 min550 BASE XP

Precision Source Attribution

The Citations API 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

// Request with citations
const response = await anthropic.messages.create({
  model: "claude-sonnet-4-6",
  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." }
    ]
  }]
});
🔑 Key Requirement: Citations must be enabled for Claude to perform full visual PDF analysis (charts, graphs, layouts). Without citations enabled, PDFs are processed as text-only.
SYNAPSE VERIFICATION
QUERY 1 // 3
What does the Citations API prevent?
Token overflow
Hallucination — by grounding every claim in source documents with precise references
Rate limiting
Context window exhaustion
Watch: 139x Rust Speedup
Document-Grounded Citations | Citations & Files API — Claude Academy