Skip to main content
POST
/
spans
/
{span_id}
/
metrics
cURL
curl -X POST https://api.opper.ai/v2/spans/123e4567-e89b-12d3-a456-426614174000/metrics \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${OPPER_API_KEY}" \
  -d '{
    "dimension": "response_quality",
    "value": 8.5,
    "comment": "Quality score based on human evaluation (1-10 scale)"
  }'
{
  "dimension": "<string>",
  "value": 123,
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "comment": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

span_id
string<uuid>
required

The id of the span

Body

application/json
dimension
string
required

The dimension of the metric

value
number
required

The value of the metric

comment
string | null

A comment about the metric, e.g. a description of the metric

Response

Successful Response

dimension
string
required

The dimension of the metric

value
number
required

The value of the metric

id
string<uuid>
required
span_id
string<uuid>
required
created_at
string<date-time>
required
comment
string | null

A comment about the metric, e.g. a description of the metric