← All tools
[1]
AI

Citations API Response Viewer

Paste a Claude Citations API response to see the answer text with each cited passage highlighted and matched to its source document, location, and quoted text. Optionally paste the source document to verify the citation's character indices actually match. 100% client-side.

πŸ”’ Runs entirely in your browser β€” no data is ever sent anywhere

When you need a Citations API response viewer

Anthropic's Citations API feature lets Claude back its answer with specific passages from a source document, but the response comes back as a content array split across multiple blocks, each carrying its own citations with character or page indices into the source β€” genuinely useful data, but not something you can eyeball in raw JSON. This tool is for exactly the moment you're integrating that feature and need to see, at a glance, whether the highlighted answer text actually lines up with the source passage it claims to cite, before shipping it in front of real users.

What this tool checks, and how to read a mismatch

Paste the full Messages API response, just its content array, or a single content block β€” this tool detects which shape you gave it. Each citation's location is one of three types depending on the source document format: char_location (plain text, using start/end character indices), page_location (PDFs, using page numbers), or content_block_location (custom content blocks, using block indices). When you also paste the original source document, the viewer slices it at the citation's exact indices and compares that slice to the cited_text Claude returned β€” a mismatch here almost always means you're comparing against a different version of the document than the one actually sent in the original request (different whitespace, a re-exported copy, an edited draft), not a bug in the Citations API itself.

Frequently asked questions

What is the Claude Citations API?

It's a Messages API feature where you mark a document content block with citations: { enabled: true }. Instead of one plain text response, Claude splits its answer into multiple text blocks, and any block backed by a source document carries a citations array β€” each entry has the cited_text, which document it came from (document_index / document_title), and a location: a char_location (start_char_index/end_char_index) for plain text, a page_location (start_page_number/end_page_number) for PDFs, or a content_block_location (start_block_index/end_block_index) for custom content blocks.

What exactly do I paste into this tool?

The full Messages API response JSON, just its content array, or a single content block β€” this tool detects which one you gave it. The easiest way to get one is to log response.content (or the whole response) from a request where at least one document block had citations enabled, then paste that straight in.

Why does it say a citation's indices don't match my source text?

The verifier slices your pasted document at the citation's start_char_index and end_char_index and compares that exact slice to cited_text. A mismatch almost always means you pasted a different version of the document than the one actually sent in the request β€” different whitespace, a re-exported copy, or an edited draft β€” not a bug in the Citations API itself. It's meant as a debugging aid for your own integration.

Related AI tools

Bracketly is free and open-source. If this tool saved you time, consider supporting it.

β˜• Buy me a coffee