Get context attribution
Compute context attribution scores for a model response given a set of source documents.
context— The context text provided to the modelquery— The user’s query or questionresponse— The model’s response to attribute
model— Model used for attribution computation (default:Llama-3.1-8B-Instruct)highlight— A specific portion of the response to attribute. If omitted, returns attributions for all response segments.granularity— How to partition the context:sentenceorchunktop_k— Number of top sources to return per segmentnum_ablations— Advanced tuning parameter (32–256)
Authorizations
Seekr API Key without 'Bearer' Prefix
Body
Request model for context attribution.
Computes which parts of the context contributed to the model's response using the ContextCite algorithm.
The context text provided to the model.
The user's question/query.
The model's response to attribute.
Specific portion of response to attribute. If None, attributes all segments.
Granularity for partitioning context: sentence or paragraph.
sentence, paragraph Number of top attributed sources to return per segment.
x >= 1Number of ablation experiments to run. If None, computed dynamically using O(k log d) formula. Must be between 32 and 256 (inclusive) if specified.
If True, include diagnostic information in the response.
Response
Successful Response
Response model for context attribution.
The full response text that was attributed.
Attribution results for each response segment. Populated when highlight is not provided.
The highlighted portion of the response (if provided in request).
Context sources for the highlight. Only populated when highlight is provided.
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.
- ToolResponseSource
- RawContextSource
Diagnostic information. Only populated when return_diagnostics=True.