Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Get Project KPI Cards

POST/v1/private/projects/{id}/kpi-cardsGet Project KPI Cards

Gets KPI card metrics for a project

Parameters

idstring · uuidpathrequired

Request body

application/json
objectKpiCardRequest
entity_typestringrequired

one of "traces", "spans", "threads"

filtersstring
interval_endstring · date-time
interval_startstring · date-timerequired
Example request
{
  "entity_type": "spans",
  "filters": "string",
  "interval_end": "2026-06-09T00:00:00Z",
  "interval_start": "2026-06-09T00:00:00Z"
}

Responses

200KPI Card Metricsapplication/json
objectKpiCardResponse
statsarray of object
Show child attributes
Show array items
current_valuenumber · double

Metric value for the current period. Unit depends on `type`: `count` is an integer count; `errors` is a percentage in [0, 100]; `avg_duration` is milliseconds; `total_cost` is in USD.

previous_valuenumber · double

Metric value for the immediately preceding period of equal length. Same unit as `current_value`.

typestring

one of "count", "errors", "avg_duration", "total_cost"

Example response
{
  "stats": [
    {
      "current_value": 0,
      "previous_value": 0,
      "type": "avg_duration"
    }
  ]
}
400Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu