Skip to main content
GET
/
v1
/
metrics
Get Metrics
curl --request GET \
  --url https://api.agentmark.co/v1/metrics \
  --header 'Authorization: <api-key>' \
  --header 'X-Agentmark-App-Id: <x-agentmark-app-id>'
{
  "metrics": [
    {
      "timestamp": "2026-04-10T00:00:00.000Z",
      "traceCount": 150,
      "spanCount": 420,
      "totalTokens": 125000,
      "totalCost": 0.85,
      "avgLatencyMs": 823.5,
      "errorRate": 0.02
    },
    {
      "timestamp": "2026-04-11T00:00:00.000Z",
      "traceCount": 175,
      "spanCount": 490,
      "totalTokens": 142000,
      "totalCost": 0.97,
      "avgLatencyMs": 756.2,
      "errorRate": 0.01
    }
  ]
}

Authorizations

Authorization
string
header
required

Your AgentMark API key. Create one in the dashboard under Settings > API Keys.

Example: Authorization: Bearer am_live_abc123

Headers

X-Agentmark-App-Id
string
required

Your application ID. Found in the dashboard under Settings > General.

Example:

"app_abc123"

Query Parameters

startDate
string<date-time>

Start of the time range (ISO 8601). Defaults to 7 days ago.

endDate
string<date-time>

End of the time range (ISO 8601). Defaults to now.

granularity
enum<string>
default:day

Time bucket granularity for aggregation.

Available options:
hour,
day,
week
model
string

Filter metrics by model name.

name
string

Filter metrics by span name.

Response

Aggregated metrics.

metrics
object[]