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{
"requests": [
{
"date": "<string>",
"value": 123
}
],
"errors": [
{
"date": "<string>",
"value": 123
}
],
"speed": [
{
"date": "<string>",
"value": 123
}
],
"prompt_tokens": [
{
"date": "<string>",
"value": 123
}
],
"completion_tokens": [
{
"date": "<string>",
"value": 123
}
],
"top_models": [
{
"model": "<string>",
"count": 123
}
],
"speed_percentiles_timeseries": [
{
"date": "<string>",
"p50": 123,
"p95": 123,
"p99": 123
}
],
"totals": {
"estimated_cost_usd": 123,
"priced_token_share": 123,
"priced_tokens": 123,
"total_tokens": 123,
"unpriced_models": [
"<string>"
],
"pricing_fetched_at": "<string>",
"cost_source": "stored",
"cost_lower_bound": true,
"cost_lower_bound_reasons": [
"unpriced_models"
],
"model_breakdown_truncated": true,
"requests": 123,
"errors": 123,
"avg_speed": 123,
"prompt_tokens": 123,
"completion_tokens": 123,
"speed_percentiles": {
"p50": 123,
"p95": 123,
"p99": 123
},
"cost_rollup_truncated": true
}
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}Get project analytics
Returns one analytics payload selected by the view discriminator. Omit view or pass view=general for the legacy timeseries + top-models contract. 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.
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{
"requests": [
{
"date": "<string>",
"value": 123
}
],
"errors": [
{
"date": "<string>",
"value": 123
}
],
"speed": [
{
"date": "<string>",
"value": 123
}
],
"prompt_tokens": [
{
"date": "<string>",
"value": 123
}
],
"completion_tokens": [
{
"date": "<string>",
"value": 123
}
],
"top_models": [
{
"model": "<string>",
"count": 123
}
],
"speed_percentiles_timeseries": [
{
"date": "<string>",
"p50": 123,
"p95": 123,
"p99": 123
}
],
"totals": {
"estimated_cost_usd": 123,
"priced_token_share": 123,
"priced_tokens": 123,
"total_tokens": 123,
"unpriced_models": [
"<string>"
],
"pricing_fetched_at": "<string>",
"cost_source": "stored",
"cost_lower_bound": true,
"cost_lower_bound_reasons": [
"unpriced_models"
],
"model_breakdown_truncated": true,
"requests": 123,
"errors": 123,
"avg_speed": 123,
"prompt_tokens": 123,
"completion_tokens": 123,
"speed_percentiles": {
"p50": 123,
"p95": 123,
"p99": 123
},
"cost_rollup_truncated": true
}
}{
"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. Omit for the general timeseries payload so existing callers keep working.
general, 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.
General-view lookback hours. Defaults to 24.
day, week, or month.
day, week, month Response
Project analytics view
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes