Metrics
Per-agent analytics
Agent comparison analytics: run counts, success rate, total cost, average tokens over the range.
GET
/
api
/
metrics
/
analytics
/
agents
Per-agent analytics
curl --request GET \
--url https://api.tedro.io/api/metrics/analytics/agents \
--header 'x-workspace-id: <api-key>' \
--cookie better-auth.session_token=import requests
url = "https://api.tedro.io/api/metrics/analytics/agents"
headers = {
"cookie": "better-auth.session_token=",
"x-workspace-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {cookie: 'better-auth.session_token=', 'x-workspace-id': '<api-key>'}
};
fetch('https://api.tedro.io/api/metrics/analytics/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tedro.io/api/metrics/analytics/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "better-auth.session_token=",
CURLOPT_HTTPHEADER => [
"x-workspace-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tedro.io/api/metrics/analytics/agents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "better-auth.session_token=")
req.Header.Add("x-workspace-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tedro.io/api/metrics/analytics/agents")
.header("cookie", "better-auth.session_token=")
.header("x-workspace-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tedro.io/api/metrics/analytics/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'better-auth.session_token='
request["x-workspace-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agents": [
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"totalRuns": 123,
"succeeded": 123,
"failed": 123,
"successRate": 123,
"totalCost": 123,
"avgTokens": 123
}
]
}{
"error": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Session cookie set by Better Auth on sign-in.
Workspace UUID. Required on all /api/* endpoints.
Query Parameters
Preset range. Use "custom" with from/to for explicit windows.
Available options:
24h, 7d, 30d, custom ISO 8601 datetime (required when range=custom)
ISO 8601 datetime (required when range=custom)
Response
Agent analytics rows
Per-agent run counts, success rate, and cost totals for the range
Show child attributes
Show child attributes
Previous
Sign in with email + passwordAuthenticate an existing user and return a session. Sets the Better Auth session cookie on success.
Next
⌘I
Per-agent analytics
curl --request GET \
--url https://api.tedro.io/api/metrics/analytics/agents \
--header 'x-workspace-id: <api-key>' \
--cookie better-auth.session_token=import requests
url = "https://api.tedro.io/api/metrics/analytics/agents"
headers = {
"cookie": "better-auth.session_token=",
"x-workspace-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {cookie: 'better-auth.session_token=', 'x-workspace-id': '<api-key>'}
};
fetch('https://api.tedro.io/api/metrics/analytics/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tedro.io/api/metrics/analytics/agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "better-auth.session_token=",
CURLOPT_HTTPHEADER => [
"x-workspace-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tedro.io/api/metrics/analytics/agents"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "better-auth.session_token=")
req.Header.Add("x-workspace-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tedro.io/api/metrics/analytics/agents")
.header("cookie", "better-auth.session_token=")
.header("x-workspace-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tedro.io/api/metrics/analytics/agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'better-auth.session_token='
request["x-workspace-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"agents": [
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"totalRuns": 123,
"succeeded": 123,
"failed": 123,
"successRate": 123,
"totalCost": 123,
"avgTokens": 123
}
]
}{
"error": "<string>",
"details": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}