Skip to main content
Most products should use POST /v1/attributions. Reach for the raw heatmap when you want to see the attention itself, write your own aggregation, or debug why a phrase resolved the way it did.

1. Fetch the heatmap

2. Map cells back to text

row, col, and data are parallel arrays. Each index i is one cell: answer token row[i] pays data[i] of its attention to document token col[i].

3. Build a dense matrix

Rows are answer tokens and columns are document tokens. Cells below threshold stay 0.

4. Plot it

5. Aggregate a phrase yourself

To see where one answer phrase points, add up its tokens’ rows. This is the first step /v1/attributions takes before it picks a contiguous source range:

When to use which endpoint