Does TokenPath generate answers?
No. TokenPath attributes an answer you already have, from any model. The optionalPOST /v1/generate endpoint exists only so demos can run on a TokenPath key alone.
Does it work with my model?
Yes. TokenPath needs only the text: the document, the question, and the answer. It does not need your model’s weights, logprobs, or prompts. Answers from GPT, Claude, Gemini, Llama, a fine-tune, or a multi-step agent all work the same way.Which endpoint should I use?
POST /v1/attributions for almost everything. Use POST /v1/attributions/heatmap only when you need raw token-level attention.
How long can the document be?
With an API key, up to 4,000,000 characters, and at most 1,050,000 tokens, on/v1/attributions. Long text is split into windows automatically. The question and answer can be up to 10,000 characters each. See Long documents.
Without a key, the limits are 20,000 Unicode characters for the document and 2,000 each for question and answer. See keyless access.
How fast is it?
A 20,000-token document, about 30 pages, typically returns in under two seconds. Windowed requests for very long documents take longer. Give those a client timeout of 300 seconds.Can I attribute against several documents at once?
Yes. Join them into onedocument and record where each one starts, then map each source range back to its document. See Multiple documents.
Does it work with PDFs?
Yes, on the extracted text. Keep a map from character offsets to page coordinates, and you can highlight the exact supporting text on the page. See PDF attribution.Does it work in other languages?
Yes, including across languages. For example, an answer in Hindi can be attributed to an English source. TokenPath has been benchmarked on 23 languages. See the multilingual benchmark.What does confidence mean?
It is the strength of one link between an answer phrase and a source range, from 0 to 1. Use it to rank and style citations. It says where text came from, not whether the answer is correct. See Confidence.
Why is my highlight off by a few characters?
Almost always, theoffset_encoding doesn’t match your language. The default is utf-16, which suits JavaScript. Send utf-32 from Python and utf-8 from Go or Rust. See Offsets and encoding.
