curl --request GET \
--url https://api.trulayer.ai/v1/traces \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/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.trulayer.ai/v1/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.trulayer.ai/v1/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.trulayer.ai/v1/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.trulayer.ai/v1/traces")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/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{
"traces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error": "<string>",
"tags": [
"<string>"
],
"started_at": "2023-11-07T05:31:56Z",
"session_id": "<string>",
"external_id": "<string>",
"name": "<string>",
"input": "<string>",
"output": "<string>",
"model": "<string>",
"latency_ms": 123,
"cost": 123,
"total_token_count": 123,
"prompt_tokens_total": 123,
"completion_tokens_total": 123,
"tag_map": {},
"metadata": {},
"span_count": 123,
"control_loop_depth": 123,
"spans": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "llm",
"parent_span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": "<string>",
"output": "<string>",
"model": "<string>",
"latency_ms": 123,
"cost": 123,
"error": "<string>",
"prompt_tokens": 123,
"completion_tokens": 123,
"metadata": {},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"otel_trace_id": "<string>",
"otel_span_id": "<string>"
}
],
"ended_at": "2023-11-07T05:31:56Z"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": "<string>"
}List traces with cursor-based pagination
curl --request GET \
--url https://api.trulayer.ai/v1/traces \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/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.trulayer.ai/v1/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.trulayer.ai/v1/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.trulayer.ai/v1/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.trulayer.ai/v1/traces")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/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{
"traces": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error": "<string>",
"tags": [
"<string>"
],
"started_at": "2023-11-07T05:31:56Z",
"session_id": "<string>",
"external_id": "<string>",
"name": "<string>",
"input": "<string>",
"output": "<string>",
"model": "<string>",
"latency_ms": 123,
"cost": 123,
"total_token_count": 123,
"prompt_tokens_total": 123,
"completion_tokens_total": 123,
"tag_map": {},
"metadata": {},
"span_count": 123,
"control_loop_depth": 123,
"spans": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "llm",
"parent_span_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": "<string>",
"output": "<string>",
"model": "<string>",
"latency_ms": 123,
"cost": 123,
"error": "<string>",
"prompt_tokens": 123,
"completion_tokens": 123,
"metadata": {},
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"otel_trace_id": "<string>",
"otel_span_id": "<string>"
}
],
"ended_at": "2023-11-07T05:31:56Z"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": "<string>"
}Authorizations
SDK API key (tl_...) or Clerk session JWT
Query Parameters
Filter traces with spans matching this failure type (e.g. timeout, rate_limit, invalid_response, context_length)
timeout, rate_limit, invalid_response, context_length Minimum trace latency in milliseconds (inclusive). Must be a non-negative integer.
x >= 0Maximum trace latency in milliseconds (inclusive). Must be a non-negative integer and greater than or equal to latency_min when both are supplied.
x >= 0Minimum total token count (prompt + completion, summed across
spans) for the trace (inclusive). Must be a non-negative
integer. Traces ingested before TRU-250 report
total_token_count = 0 and are therefore excluded by any
non-zero minimum.
x >= 0Maximum total token count for the trace (inclusive). Must be a
non-negative integer and greater than or equal to
token_count_min when both are supplied.
x >= 0Filter traces whose tags column contains the
tag_key → tag_value pair (TRU-215). Must be supplied
together with tag_value; providing only one side returns
400 error.tags_filter_incomplete.
Filter value paired with tag_key. See tag_key for
constraints.
1 <= x <= 200