Skip to main content

LLM Judge API — evaluate and orchestrate judges

List judge configurations, evaluate LLM outputs, retrieve results, and measure judge alignment with true positive and true negative rates.
The LLM Judge API lets you programmatically run AI-powered quality assessments on any input/output pair. Use it to build automated evaluation pipelines, measure judge credibility against human labels, and retrieve detailed scoring breakdowns — including reasoning, signals, and confidence metrics.
Judge calls require bring your own provider key (BYOK). Your EvalGate bearer token authenticates this API request, while the provider or gateway credential authorizes the model call. EvalGate does not bundle inference credits; the connected provider bills usage directly.

GET /api/llm-judge/configs — list judge configurations

Returns the judge configurations available in your organization.

Response


POST /api/llm-judge/evaluate — evaluate an output

Submits an input/output pair for evaluation by a judge. You can reference a saved configuration by configId, or pass a judgeConfig object inline.

Request body

string
required
The original prompt or user query that was sent to your LLM.
string
required
The LLM response to evaluate.
integer
ID of a saved judge configuration. Use this or judgeConfig — not both.
object
Inline judge configuration. Use this when you do not have a saved config.

Response

string
LLM provider used for the judge call.
string
Model used for the judge call.
integer
Quality score from 0–100.
boolean
Whether the output met the passing threshold defined in the judge config.
string
The judge’s natural-language explanation of the score.
array
List of signal strings the judge identified — positive indicators, failure patterns, or flagged behaviors.
integer
Time in milliseconds the judge call took.
integer
Total tokens consumed by the judge call.
integer
Number of retries the judge performed before returning a parseable result.
string
Whether the judge’s response was parsed cleanly. ok means structured output was extracted successfully.
object | null
When using a multi-judge committee, this field contains disagreement metrics across judges. null for single-judge evaluations.

GET /api/llm-judge/results — get evaluation results

Returns stored evaluation results for review, filtering, or export.

Query parameters

integer
Filter results to a specific judge configuration.
integer
Maximum number of results to return. Defaults to 50.
integer
Pagination offset. Defaults to 0.

POST /api/llm-judge/alignment

Check judge alignment against human labels and return agreement metrics. Measures how well a judge agrees with human labels by computing true positive rate (TPR) and true negative rate (TNR) against your annotation dataset. Run this after collecting a sufficient set of human labels via the Annotations API.

Request body

integer
required
ID of the judge configuration to measure.
integer
required
ID of the annotation task containing the human labels to compare against.

Response

number
True positive rate — fraction of human-labeled passes that the judge also marked as passed.
number
True negative rate — fraction of human-labeled failures that the judge also marked as failed.
number
Overall agreement rate between the judge and human labels.
integer
Number of labeled items used for this alignment calculation.
Target a TPR and TNR above 0.85 before using a judge to gate CI runs. Lower alignment means the judge may block good outputs or miss real failures.