Get project analytics
curl --request GET \
--url https://api.uselemma.ai/projects/{project_id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.uselemma.ai/projects/{project_id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.uselemma.ai/projects/{project_id}/analytics', 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.uselemma.ai/projects/{project_id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.uselemma.ai/projects/{project_id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.uselemma.ai/projects/{project_id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselemma.ai/projects/{project_id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"state": "connect",
"counts": {
"agents": 123,
"lifetime_traces": 123,
"issues": 123,
"resolved": 123
},
"base": {
"caught": [
{
"date": "<string>",
"value": 123
}
],
"resolved": [
{
"date": "<string>",
"value": 123
}
],
"dismissed": [
{
"date": "<string>",
"value": 123
}
],
"traces": [
{
"date": "<string>",
"value": 123
}
],
"errors": [
{
"date": "<string>",
"value": 123
}
],
"artifact_iterations": [
{
"date": "<string>",
"value": 123
}
],
"resolution_days": [
{
"date": "<string>",
"value": 123
}
]
}
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}Projects
Get project analytics
Returns one analytics payload selected by the required view discriminator. Specialized views do not compute unrequested panels. Cost figures are Lemma estimates from observed token counts and public LiteLLM list prices — not invoice amounts. Backfilled rows carry the price as of the backfill run, not the price as of the call.
GET
/
projects
/
{project_id}
/
analytics
Get project analytics
curl --request GET \
--url https://api.uselemma.ai/projects/{project_id}/analytics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.uselemma.ai/projects/{project_id}/analytics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.uselemma.ai/projects/{project_id}/analytics', 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.uselemma.ai/projects/{project_id}/analytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.uselemma.ai/projects/{project_id}/analytics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.uselemma.ai/projects/{project_id}/analytics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselemma.ai/projects/{project_id}/analytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"state": "connect",
"counts": {
"agents": 123,
"lifetime_traces": 123,
"issues": 123,
"resolved": 123
},
"base": {
"caught": [
{
"date": "<string>",
"value": 123
}
],
"resolved": [
{
"date": "<string>",
"value": 123
}
],
"dismissed": [
{
"date": "<string>",
"value": 123
}
],
"traces": [
{
"date": "<string>",
"value": 123
}
],
"errors": [
{
"date": "<string>",
"value": 123
}
],
"artifact_iterations": [
{
"date": "<string>",
"value": 123
}
],
"resolution_days": [
{
"date": "<string>",
"value": 123
}
]
}
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project ID.
Query Parameters
Analytics view to return.
Available options:
base, window, model_scorecard, agent_scorecard, tool_aggregates, roi Inclusive window start (ISO-8601).
Optional inclusive window end (ISO-8601).
Exclusive window end (ISO-8601). Required for base, window, agent_scorecard, and tool_aggregates.
day, week, or month.
Available options:
day, week, month