POST /v1/verify

POST /v1/verify scores a candidate answer with the production cascade verifier, which decides if a cheaper model's answer is returned or escalated.

POSThttps://api.getnadir.com/v1/verify

Score a candidate answer with the production cascade verifier. This is the check that decides whether a cheap model's answer is good enough to return, or whether the request should escalate. No LLM call.

Authentication

Required. Send your key as X-API-Key.

Request body

promptstringrequired

The prompt the answer responds to.

answerstringrequired

Candidate answer to score, typically from the cheaper model.

reference_answerstring

Optional answer from a strong model to compare against. When supplied, the score becomes a calibrated blend of the verifier and the agreement between the two answers' conclusions, which is measurably sharper than the verifier alone.

peer_answerstring

Optional second cheap attempt at the same prompt, from another model or a retry. Its conclusion agreement is returned as pair_jaccard for your own thresholds; it does not change the score. Ignored when reference_answer is also supplied.

thresholdnumber

Acceptance threshold in the range 0 to 1. Defaults to the calibrated production threshold.

Example

Request
curl https://api.getnadir.com/v1/verify \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $NADIR_API_KEY" \
  -d '{
    "prompt": "What year did the Apollo 11 mission land on the Moon?",
    "answer": "Apollo 11 landed on the Moon in July 1969."
  }'

Response

scorenumberrequired

Probability that the answer is acceptable, in the range 0 to 1.

acceptedbooleanrequired

Whether score is at or above the threshold.

thresholdnumberrequired

Threshold applied to this call.

reference_freebooleanrequired

True when no reference answer was supplied.

pair_signal_usedbooleanrequired

True when conclusion agreement was blended into the score, which happens when a reference answer was supplied.

pair_jaccardnumber

Word overlap between the final 64 words of the answer and the reference or peer, in the range 0 to 1. Present only when a second answer was supplied.

latency_msintegerrequired

Verification latency in milliseconds.

Info

Field names and types on this page are taken from the deployed schema at api.getnadir.com/openapi.json. The values in the example response are illustrative, not a recorded call.

Using it as a cascade gate

The usual pattern is to answer on a cheap model, verify, and escalate only when the verifier rejects. Raising threshold escalates more often, which costs more and catches more. Lowering it does the reverse. The default is the threshold Nadir runs in production.

Python
cheap = call_model("claude-haiku-4-5", prompt)

check = httpx.post(
    "https://api.getnadir.com/v1/verify",
    headers={"X-API-Key": NADIR_API_KEY},
    json={"prompt": prompt, "answer": cheap},
).json()

answer = cheap if check["accepted"] else call_model("claude-opus-4-6", prompt)

Supplying a second answer

Whether two independent answers agree on their conclusion is a strong correctness signal, and it lives at the end of the answer, not the start. When you pass reference_answer, the verifier blends its own score with the overlap of the two answers' final 64 words. On our held-out verification corpus this lifts AUROC from 0.75 for the verifier alone to 0.93.

A peer_answer from a second cheap model is a weaker witness, agreement between two weak models proves less, so it is reported as pair_jaccard without moving the score. Use it for your own escalation rules, for example escalating when two cheap attempts disagree.

Warning

The verifier is a probability, not a proof. It is trained reference-free, so it scores whether an answer looks acceptable for the prompt without knowing the right answer. Treat accepted as a routing signal, not as a correctness guarantee.

Errors

503verifier_unavailable

Verifier weights are not loaded on the instance that served the request. Retry, and fall back to your own escalation rule if it persists.

Pages on this site

Machine-readable summaries of this site: llms.txt and llms-full.txt.