curl --request GET \
--url https://api.galtea.ai/traces \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/traces"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/traces', 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.galtea.ai/traces",
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.galtea.ai/traces"
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.galtea.ai/traces")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/traces")
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[
{
"id": "trace_123",
"inferenceResultId": "ir_123",
"name": "fetch_user_data",
"type": "TOOL",
"description": "Fetches user data from the database by ID",
"inputData": {
"user_id": "123"
},
"outputData": {
"name": "John Doe",
"email": "john@example.com"
},
"error": "Connection timeout",
"latencyMs": 45.5,
"metadata": {
"model": "gpt-4",
"temperature": 0.7
},
"parentTraceId": "trace_parent_123",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"modelId": "model_123",
"modelName": "gpt-4o-mini",
"inputTokens": 100,
"outputTokens": 50,
"cacheReadInputTokens": 20,
"tokens": 170,
"costPerInputToken": 0.00001,
"costPerOutputToken": 0.00003,
"costPerCacheReadInputToken": 0.000005,
"cost": 0.0026
}
]{
"error": "Error type",
"message": "Error message description"
}Get spans
Get a list of spans with filtering and pagination. See Spans. These endpoints serve spans, the steps inside a trace. Their REST path /traces keeps the old name of this entity.
curl --request GET \
--url https://api.galtea.ai/traces \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/traces"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/traces', 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.galtea.ai/traces",
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.galtea.ai/traces"
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.galtea.ai/traces")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/traces")
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[
{
"id": "trace_123",
"inferenceResultId": "ir_123",
"name": "fetch_user_data",
"type": "TOOL",
"description": "Fetches user data from the database by ID",
"inputData": {
"user_id": "123"
},
"outputData": {
"name": "John Doe",
"email": "john@example.com"
},
"error": "Connection timeout",
"latencyMs": 45.5,
"metadata": {
"model": "gpt-4",
"temperature": 0.7
},
"parentTraceId": "trace_parent_123",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"modelId": "model_123",
"modelName": "gpt-4o-mini",
"inputTokens": 100,
"outputTokens": 50,
"cacheReadInputTokens": 20,
"tokens": 170,
"costPerInputToken": 0.00001,
"costPerOutputToken": 0.00003,
"costPerCacheReadInputToken": 0.000005,
"cost": 0.0026
}
]{
"error": "Error type",
"message": "Error message description"
}Authorizations
Query Parameters
Filter by span types. Only the values below are accepted, and any other value gives a 400. A span whose declared type was outside this list is stored under the type it was normalized to on write, so filter by that one. An LLM span is a GENERATION.
SPAN, GENERATION, EVENT, AGENT, TOOL, CHAIN, RETRIEVER, EVALUATOR, EMBEDDING, GUARDRAIL Response
Spans retrieved successfully
The model that answered this LLM call, matched by name when the span was ingested. Null when no live model of the organization, or global model, had any of the model names of the span. A name also matches without its provider prefix. Deleting the model keeps it, so it can name a deleted model.
"model_123"
Cost of this call at the frozen rates. Null when no rates were found. A turn's cost sums the costs of the spans it counts. A call counts once for each side, input and output, from the deepest span that reports it. A span that loses one side to a span below is priced again for the side it keeps. Null without evaluation.readInference on the product.
0.0026