Scores are first-class objects on the trace record: you can filter, sort, and build dashboards on them alongside latency, tokens, and cost.
Basic usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
trace_id | str or UUID | Yes | The trace to score |
name | str | Yes | Score name (for example, accuracy, user_satisfaction) |
value | str | Yes | The score value (always passed as a string) |
data_type | str | No | One of NUMERIC, BOOLEAN, CATEGORICAL. Default: NUMERIC |
reason | str or None | No | Human-readable explanation for the score |
metadata | dict or None | No | Arbitrary key-value pairs |
Score data types (ScoreDataType)
- NUMERIC
- BOOLEAN
- CATEGORICAL
A numeric value (for example,
"0.95", "4.5"). Use for continuous metrics such as accuracy, latency, or satisfaction scores.value is always a string at the API boundary so serialization stays consistent across languages and storage backends; parse according to data_type in your pipelines.