POST /v1/attributions.
Requires the attributions:write scope. See Raw heatmap for how to read the result.
Request body
The source text. 1 to 400,000 characters. The heatmap comes from a single model pass and is never windowed, so the whole request (document, question, and answer) must fit that pass: currently 32,768 tokens, roughly 100,000 characters of English prose. The limit depends on the GPU serving the model. A request that does not fit fails with
413 prompt_too_long, whose details give prompt_tokens and max_prompt_tokens. For longer documents, use POST /v1/attributions, which splits them into windows automatically.The unit for
answer_offsets and document_offsets: utf-16, utf-32, or utf-8. See Offsets and encoding.The smallest attention value to include. Range
0 to 1. Lower values return denser, larger responses.Response
The share of answer token
row[i]’s attention that lands on document token col[i], from 0 to 1.prompt_tokens is the number of tokens the model processed, which is what you are billed for. document_tokens and answer_tokens are the parts of that count taken up by your document and answer.[7, 16] is " improved"), and one word can span several tokens. Always slice with the returned offsets rather than splitting on whitespace.
