Mastra launches Metrics API for token usage, cost, latency and error queries
Overview
Mastra releases a Metrics API that queries token usage, model cost, latency and error rates from production projects, according to a Mastra blog post.
The API returns totals, breakdowns, time series and percentiles, with time range and status filters. Developers can call it through the Mastra Client SDK (@mastra/client-js 1.9.0 or later), the Mastra CLI (mastra 1.9.2 or later), or observability endpoints. Metric queries require a platform access token and the project ID, sent with each request.
Written by AI from the articles below · updated Oct 13, 1:25 PM ET
Check the sources:
Article timeline
The articles in this story. Times are ET.
- Mastra BlogOfficialMastra releases a Metrics API for querying token usage, cost, latency, and errors
AIMastra's platform now offers a Metrics API that queries token usage, model cost, latency, and error rates from production projects. Developers can access it through the Mastra Client SDK (@mastra/client-js 1.9.0 or later), the Mastra CLI (mastra 1.9.2 or later), or observability endpoints. The API supports totals, breakdowns, time series, and percentile data, with time ranges and status filters.
Heat trend
Not enough continuous observations to show a trend yet.