curl --request GET \
--url https://dev.api.galtea.ai/analytics/cost-breakdown \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.api.galtea.ai/analytics/cost-breakdown"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.api.galtea.ai/analytics/cost-breakdown', 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://dev.api.galtea.ai/analytics/cost-breakdown",
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://dev.api.galtea.ai/analytics/cost-breakdown"
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://dev.api.galtea.ai/analytics/cost-breakdown")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/analytics/cost-breakdown")
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{
"rows": [
{
"key": "<string>",
"label": "<string>",
"llmSpanCount": 123,
"inputTokens": 123,
"outputTokens": 123,
"cost": 123
}
],
"total": {
"llmSpanCount": 123,
"inputTokens": 123,
"outputTokens": 123,
"cost": 123
}
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}Get the estimated cost, LLM spans and tokens of a period split by model, version or end user
The sessions GET /analytics/cost-overview counts, split into one row per model, version or end user, with every row returned. The rows add up to the totalCost of GET /analytics/cost-overview for the same filters. The end user is only set on turns built from OpenTelemetry spans. Needs evaluation.readInference on every product of the sum, else 403.
curl --request GET \
--url https://dev.api.galtea.ai/analytics/cost-breakdown \
--header 'Authorization: Bearer <token>'import requests
url = "https://dev.api.galtea.ai/analytics/cost-breakdown"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://dev.api.galtea.ai/analytics/cost-breakdown', 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://dev.api.galtea.ai/analytics/cost-breakdown",
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://dev.api.galtea.ai/analytics/cost-breakdown"
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://dev.api.galtea.ai/analytics/cost-breakdown")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.api.galtea.ai/analytics/cost-breakdown")
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{
"rows": [
{
"key": "<string>",
"label": "<string>",
"llmSpanCount": 123,
"inputTokens": 123,
"outputTokens": 123,
"cost": 123
}
],
"total": {
"llmSpanCount": 123,
"inputTokens": 123,
"outputTokens": 123,
"cost": 123
}
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}{
"error": "NotFound",
"message": "Product not found"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Query Parameters
Start of the period, inclusive (ISO 8601)
End of the period, exclusive (ISO 8601). A period that does not end after from, or is longer than 1830 days (5 years), is rejected with 400.
Count production sessions when true, development sessions when false.
The organization whose products to read. Defaults to the caller's own organization. Another organization reads products only for a caller that may read across organizations.
Keep the products whose name contains this (case-insensitive)
Keep the products that carry any of these tags
Keep only these products. A product outside the caller's grant is refused with 403; a product of another organization, or a deleted one, matches nothing. At most 25.
25The value each row stands for: the model that answered each LLM span, the version, or the end user of each turn
model, version, endUser "model"
Response
The cost of the products per value
Every value, the highest cost first. Each turn's estimated cost is split over the LLM spans it counts, each under the model it reports. A call counts once, except that two sibling spans that report the same call both count, as a Mistral SDK span and its llm_call_details event do. The part of a turn's cost that its spans do not carry goes to the version model. So the rows add up to total, which is the totalCost of GET /analytics/cost-overview for the same filters.
Show child attributes
Show child attributes
The sum of every row
Show child attributes
Show child attributes