Skip to main content
A score is a number, a yes or no, or a label on one trace, one span or one session. It can come long after the trace: from a person, an LLM judge or a test.

Write scores

POST /v1/scores writes a list of scores. Right: write. It needs Content-Type: application/json.
object[]
required
The scores, each a score object. Here at may be left out: it is then the time the server receives the score.
integer
The number of scores written.
  • A score replaces the score with the same target, name, source, author and eval id.
  • A score that breaks a rule gets 400, and the server writes nothing of its request.
  • A busy server answers 429 with Retry-After: 1.

Get the scores of a trace

GET /v1/traces/:id/scores returns {"scores": [score]}: the scores on the trace and on its spans, by time, then name. Right: read.
string
required
The trace id.

Get the scores on a session

GET /v1/sessions/:id/scores returns {"scores": [score]}: the scores on the session itself, by time, then name. With none, the list is empty. Right: read.
string
required
The session id.
Scores on a session are not in GET /v1/traces/:id/scores, and not in anyScore. They go with a delete of the session. They also go when a delete or the retention removes the last trace of their session.

The score object

string
The trace of the score. Left out for a score on a session.
string | null
With traceId: the score is on this span. null: on the whole trace.
string
The score is on this session, with no traceId.
string
required
helpfulness, hallucination, …
number | null
A finite number. A category may have none.
string
default:"number"
"number", "boolean" (the value is 0 or 1) or "category" (it has a label). A score with a label and no value is a category.
string | null
The result of a category: pass, fail, …
string | null
The kind of giver: human, llm-judge, code, … Free text.
string
Who gave it: a user id, or the name of a judge.
string
The eval that made it: an evaluator and its version, a config, or one run of an experiment. Two runs with different ids keep one score each on the same target.
string | null
A comment, or the reason of a judge.
integer
required
The time of the score, Unix ms.
A score has one target: a trace (traceId), a span (traceId and spanId), or a session (sessionId, and no traceId). type, authorId and evalId are left out of an answer when they are not set.

Sums of scores

Averages, percentiles and label counts per group.

Sessions and scores

A guide with real scores.