Skip to main content
GET
/
v1
/
metrics
Aggregate metrics (error rate, latency percentiles, cost)
curl --request GET \
  --url https://api.trulayer.ai/v1/metrics \
  --header 'Authorization: Bearer <token>'
{
  "total_traces": 123,
  "error_count": 123,
  "from": "2023-11-07T05:31:56Z",
  "to": "2023-11-07T05:31:56Z",
  "error_rate": 123,
  "p50_latency_ms": 123,
  "p95_latency_ms": 123,
  "p99_latency_ms": 123,
  "total_cost": 123
}

Authorizations

Authorization
string
header
required

SDK API key (tl_...) or Clerk session JWT

Query Parameters

project_id
string<uuid>
from
string<date-time>

Defaults to 24h ago

to
string<date-time>

Defaults to now

Response

Metrics summary

total_traces
integer
required
error_count
integer
required
from
string<date-time>
required
to
string<date-time>
required
error_rate
number | null

Fraction 0–1; null when total_traces=0

p50_latency_ms
number | null
p95_latency_ms
number | null
p99_latency_ms
number | null
total_cost
number | null