Skip to main content

Single Comparison

Get one N-Shot comparison for a document-field pair: per-shot values with confidence and source text, agreement score, overrides, and judge recommendation.

GET /v1/jobs/runs/{runId}/nshot/comparison retrieves a single N-Shot comparison for one document-field cell, selected by the document_id and field_name query parameters. Use it when you need the full detail of one comparison: the value, confidence, and source text each shot produced, the agreement score, any existing override, and the LLM judge recommendation with its reasoning.

Comparisons are unique per (run, document, field) triple, so this endpoint always resolves to at most one row. It is typically called after identifying a problematic cell in the [comparisons list](nshot-list-shots) — or directly from the links.self URL that every list entry carries, which encodes the correct query string for you (the field_name is URL-encoded there, which matters for field names containing spaces).

Inspect the values array to see what each shot extracted and from where: entries carry confidence and source_text alongside the raw value, so you can distinguish a normalization disagreement (same source text, differently formatted values) from a genuine source ambiguity (different source passages). Then check the judgement object — when the run had the LLM judge enabled, it holds a recommended_shot, recommended_value, and a reasoning string explaining the recommendation.

If judgement.accepted is null, the recommendation is pending: submit a decision via [POST /v1/jobs/runs/{runId}/nshot/judge-decision](nshot-judge-decision) to accept or decline it. If you disagree with both the majority and the judge, select the correct shot directly with [POST /v1/jobs/runs/{runId}/nshot/override](nshot-select). Either path leaves a full audit record on the comparison.

A 404 from this endpoint does not necessarily mean the document or field is wrong — it means no comparison exists for that exact pair. Comparisons exist only for document-field cells covered by the run's N-Shot evaluation, and field_name must match the schema field key exactly (case-sensitive).
GET/v1/jobs/runs/{runId}/nshot/comparison

Query parameters

document_id*uuidDocument ID to compare.
field_name*stringField name to compare (exact match against the schema field key).

Request

curl "https://api.talonic.com/v1/jobs/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/nshot/comparison?document_id=d4e5f6a7-b8c9-0123-defa-234567890123&field_name=total_amount" \
  -H "Authorization: Bearer tlnc_your_api_key"

Response

Response fields

idstringComparison UUID.
run_idstringJob run UUID.
document_idstringDocument UUID.
field_namestringField name being compared.
statusstringAgreement status: green (unanimous), yellow (>50% agree), or red (≤50% agree).
agreement_scorenumberFraction of shots agreeing with the majority value (0-1).
majority_valuestring | nullThe value agreed on by the largest group of shots.
comparison_methodstringexact, fuzzy, or semantic.
valuesarrayPer-shot entries: shot_number, value, confidence, source_text.
overrideobject | nullOverride record if a value was manually selected.
judgementobject | nullLLM judge recommendation: recommended_shot, recommended_value, reasoning, accepted, decided_by, decided_at.
created_atstringISO 8601 creation timestamp.
links.selfstringURL to this comparison.

Response

{
  "id": "5f8e2b1a-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
  "run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "document_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
  "field_name": "total_amount",
  "status": "yellow",
  "agreement_score": 0.6667,
  "majority_value": "12450.00",
  "comparison_method": "exact",
  "values": [
    { "shot_number": 1, "value": "12450.00", "confidence": 0.95, "source_text": "Total due: 12,450.00 EUR" },
    { "shot_number": 2, "value": "12450.00", "confidence": 0.94, "source_text": "Total due: 12,450.00 EUR" },
    { "shot_number": 3, "value": "12,450.00", "confidence": 0.91, "source_text": "Total due: 12,450.00 EUR" }
  ],
  "override": null,
  "judgement": {
    "recommended_shot": 1,
    "recommended_value": "12450.00",
    "reasoning": "Shots agree on the amount; shot 3 kept the thousands separator. The canonical decimal form matches the field's number type.",
    "accepted": null,
    "decided_by": null,
    "decided_at": null
  },
  "created_at": "2026-07-14T10:32:00.000Z",
  "links": {
    "self": "/v1/jobs/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/nshot/comparison?document_id=d4e5f6a7-b8c9-0123-defa-234567890123&field_name=total_amount"
  }
}

Errors

Error responses

401unauthorizedMissing or invalid API key.
404not_foundNo job run with this ID exists for your organization, or no comparison found for the given document_id and field_name.
429rate_limitedDaily request quota for your tier reached. The counter resets at midnight UTC.

Frequently asked questions

What does a judgement with accepted: null mean?+
The LLM judge has produced a recommendation but no decision has been submitted yet. Use the judge-decision endpoint to accept or decline it; accepting automatically applies the recommended shot's value as an override.
Can a comparison have both an override and a judgement?+
Yes. If a judge decision is accepted, an override is created automatically from the recommended shot. A manual override can also coexist with a pending (not-yet-decided) judgement — the override then reflects the manual choice, not the recommendation.
Why do I get a 404 for a document and field I know exist?+
A comparison only exists for document-field pairs that were part of the run's N-Shot evaluation, and field_name is matched exactly against the schema field key. List the run's comparisons to see the pairs that were actually compared, or follow the links.self URL from a list entry, which is always correctly encoded.
Why is there no judgement on my comparison?+
The judge recommendation exists only when the run's validation configuration enabled the LLM judge alongside N-Shot, and the judge only evaluates flagged (yellow/red) cells. Green comparisons and runs without the judge enabled carry judgement: null; you can still correct such cells with a manual override.