1. Send a document, question, and answer
2. Read the response
The curl request above returned:green and yellow as the phrase in the answer that carries a fact. It then found the text that supports it in the document at characters 115 to 131. Results come back in answer order.
Loop over them like this:
spansis empty. TokenPath found nothing in the answer that it could tie to the document. Render the answer without links. This is not an error.sourceisnull. TokenPath selected an answer phrase but found no supporting text for it. Render that phrase without a link.
Next steps
- Have a coding agent do the integration: paste
Set up TokenPath in this project using https://tokenpath.ai/skill.mdinto Claude Code, Cursor, or Codex. - Build a keyless citation demo with a copyable prompt.
- Add an API key for larger inputs and normal billed access. Keyless requests have smaller input limits and a shared budget.
- Inline citations: render numbered citations from the returned offsets.
- PDF attribution: highlight evidence on the original PDF page.
- Offsets and encoding: choose the right
offset_encodingfor your language. - Errors: handle rate limits, credits, and retries.
