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
highlight— A specific portion of the response to attribute. If omitted, returns attributions for all response segments.granularity— How to partition the context:sentenceorparagraphtop_k— Number of top sources to return per segmentnum_ablations— Number of ablation experiments to run (32–256). Auto-computed if not set.return_diagnostics— Iftrue, includes internal diagnostic information in the response. Defaults tofalse.
Authorizations
Your Seekr API key, sent in the Authorization header with no '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
- SystemPromptSource
Diagnostic information. Only populated when return_diagnostics=True.