Skip to main content
POST /v1/attributions takes source text of up to 4,000,000 characters, or about a million tokens of ordinary prose, in a single call. You send the whole document and TokenPath handles the rest.

Limits

Character limits are checked first and fail with 422 validation_error. The token ceiling is counted with the attribution model’s own tokenizer, over the document only, before any inference runs.

How windowing works

A document that fits in the attribution model’s context is attributed in one pass. A 20,000-token document, about 30 pages, typically returns in under two seconds. A document that does not fit is split into overlapping, model-sized windows. TokenPath attributes the answer against each window in turn and keeps the strongest source for each answer phrase. Offsets always index into the full document you sent, never into a window. Long requests are all or nothing. You get a result only after every window succeeds. If any window fails, or the whole request runs past its time budget, the request fails and returns no partial links.
Set your HTTP client timeout to at least 300 seconds for documents longer than a few hundred thousand characters. Ordinary requests finish far sooner, and 90 seconds is plenty for them.

Errors

Billing

TokenPath first holds credits based on the full request size. When the request succeeds, you pay for the tokens the model actually processed. For a windowed request, that is the sum across windows. The question, the answer, and the overlap between neighboring windows are processed once per window, so a windowed request costs a little more than the document’s length alone suggests. See Credits and billing.

The raw heatmap

POST /v1/attributions/heatmap does not window. Its token matrix comes from one model pass, and matrices from separate windows cannot be merged without changing what the numbers mean. The whole heatmap request (document, question, and answer) must fit that one pass: currently 32,768 tokens, roughly 100,000 characters of English prose. The limit depends on the GPU serving the model, so read it from the error rather than hard-coding it. A request that does not fit returns:
To recover, send the same document, question, and answer to /v1/attributions. It returns resolved citation spans instead of a matrix, and it accepts documents of any length up to the limits above. If you need the matrix itself, shorten the document to the part that holds the answer and retry the heatmap.