Skip to main content
POST
Get Context Attribution
Determines which parts of the provided context contributed to the model’s response. Attribution can be returned for a specific highlight within the response, or broken into segments across the full response.

Authorizations

Authorization
string
header
required

Your Seekr API key, sent in the Authorization header with no 'Bearer' prefix.

Body

application/json

Request model for context attribution.

Computes which parts of the context contributed to the model's response using the ContextCite algorithm.

context
string
required

The source text given to the model.

Minimum string length: 1
query
string
required

The question sent to the model.

Minimum string length: 1
response
string
required

The model's response to the question.

Minimum string length: 1
highlight
string | null

Specific portion of the response to attribute. If omitted, attributes all segments.

Minimum string length: 1
granularity
enum<string>
default:sentence

Granularity for partitioning the context.

Available options:
sentence,
paragraph
top_k
integer
default:5

Number of top attributed sources to return per segment.

Required range: x >= 1
num_ablations
integer | null

Number of ablation experiments to run. If omitted, the endpoint computes the number dynamically. Accepts a value from 32 to 256.

return_diagnostics
boolean
default:false

If true, includes diagnostic information in the response.

Response

Success

Response model for context attribution.

response_text
string
required

The full text of the response.

segments
SegmentAttribution · object[]

Attribution results for each response segment. Populated when highlight is not provided.

highlight
string | null

The highlighted portion of the response (if provided in request).

sources
(ToolResponseSource · object | RawContextSource · object | SystemPromptSource · object)[] | null

Context sources for the highlight. Present only when you provide highlight.

A context source that originated from a tool call.

This model contains the core attribution fields plus tool-specific metadata nested in the tool field.

diagnostics
ContextAttributionDiagnostics · object | null

Diagnostic information. Populated only when return_diagnostics is true.

Last modified on October 30, 2026