Certopolis

Claude Certified Architect – Foundations

Claude citations: char_location, page_location and more

Set citations: {"enabled": true} on every document block in the request. Claude then returns text blocks with a citations list, where each entry carries the exact cited_text and a location: character offsets for plain text, page numbers for PDFs, or block indices for custom content.

How it works

Citations must be enabled on all or none of the documents in a request. The API chunks each document to set the smallest unit Claude can cite. Plain text and PDFs are chunked into sentences. Custom content documents are used as-is, so each content block you supply is one citable unit, which suits transcripts and bullet lists.

The optional title and context fields are passed to the model but are never cited from. Only text citations are supported, so a scanned PDF with no extractable text cannot be cited, even though Claude can still read the pages.

Reading the location

Plain text returns char_location with start_char_index and end_char_index: 0-indexed, end exclusive. PDFs return page_location with start_page_number and end_page_number: 1-indexed, end exclusive. Custom content returns content_block_location with start_block_index and an end index: 0-indexed, end exclusive. The document index is 0-indexed across all document blocks in the request, spanning all messages.

So a PDF citation with start_page_number 5 and end_page_number 6 points at page 5 only. When streaming, citations arrive as citations_delta events, so a handler that reads only text_delta drops them.

Cost and limits

Enabling citations adds a small number of input tokens for system prompt additions and chunking. The cited_text field does not count toward output tokens, and it is not counted as input when you pass it back in later turns. You can cache the source documents with cache_control, but not the citation blocks.

Citations cannot be combined with structured outputs. If citations are enabled on any document or search_result block and the request also sets output_config.format, the API returns a 400.

Where the exam catches people

  • Believing PDF page numbers are 0-indexed like character offsets: page_location page numbers are 1-indexed, with an exclusive end.
  • Believing quoted text is billed twice: cited_text counts toward neither output tokens nor input tokens on replay.
  • Believing you can enable citations on just some documents: it is all or none within a request.
  • Believing citations and output_config.format can be used together: the request is rejected with a 400.

Written from Anthropic's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. Your compliance tool sends three document blocks with citations: {enabled: true} and also sets output_config: {format: {...}} so the answer arrives as a fixed JSON object. Every request returns a 400 error, and both features work correctly when used alone. What is the most likely cause?

    Right. In the game that’s Renown for your Prompt Engineering, Structured Output and Retrieval building.

    Not that one: B is right. In the game your Prompt Engineering, Structured Output and Retrieval building would lose a little Renown, and this question would come back later.

  2. Your compliance viewer highlights the source of every cited claim by scrolling a rendered PDF to the referenced page. You read the page_location object on each returned citation and need to map its values onto the viewer's page control. Which approach should you take?

    Right. In the game that’s Renown for your Prompt Engineering, Structured Output and Retrieval building.

    Not that one: B is right. In the game your Prompt Engineering, Structured Output and Retrieval building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Plain-text documents use char_location with character offsets, and custom content uses content_block_location.

    Written from platform.claude.com/docs/en/build-with-claude/citations

  3. Your archive team enables citations on a batch of scanned historical PDFs that contain no embedded text layer. Claude describes the pages accurately, but no citation is ever returned for those files, while citations appear normally for the born-digital PDFs in the same batch. What is the most likely cause?

    Right. In the game that’s Renown for your Prompt Engineering, Structured Output and Retrieval building.

    Not that one: D is right. In the game your Prompt Engineering, Structured Output and Retrieval building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Only text citations are supported and image citations are not yet possible, so PDFs that are scans without extractable text cannot be cited even though Claude can still read the pages visually.

    Written from platform.claude.com/docs/en/build-with-claude/citations