curl --request GET \
--url https://api.trulayer.ai/v1/traces/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/traces/export"
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/export', 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/export",
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/export"
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/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/traces/export")
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"<string>"{
"error": "<string>"
}{
"error": "<string>"
}Stream the spans of a single trace as CSV or JSONL (sync export)
Cursor-streamed synchronous export of every span belonging to the
trace identified by trace_id. trace_id is required — the
batch “all traces” export path was removed because it was too
expensive to support at hypertable scale. Callers needing trace-
level analytics should use GET /v1/traces for paginated listing
and call this endpoint per trace.
Rows are written directly to the response body — never buffered —
and capped per plan (Starter: 100, Pro/Team/Business: 5000,
Enterprise: unlimited). Hitting the cap sets
X-TruLayer-Truncated: true; the payload is complete up to that row.
CSV columns (in order): trace_id, span_id, name, type, model, created_at, duration_ms, prompt_tokens, completion_tokens, cost_usd, trace_input, trace_output, span_input, span_output, error.
span_id is the unique identifier for the span (renamed from id).
trace_input is the parent trace’s input text joined onto every span
row. span_input is the span’s own input text. trace_output and
span_output are the parent trace’s and span’s output payloads
respectively, so a single download carries the full input/output
context for both the trace and each span.
JSONL emits one JSON object per line with the same keys.
The Content-Disposition filename is
spans-<trace-prefix>-YYYY-MM-DD.{csv,jsonl}.
curl --request GET \
--url https://api.trulayer.ai/v1/traces/export \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.trulayer.ai/v1/traces/export"
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/export', 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/export",
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/export"
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/export")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trulayer.ai/v1/traces/export")
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"<string>"{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
SDK API key (tl_...) or Clerk session JWT
Query Parameters
Trace to export spans for. Required — the endpoint returns 400 if absent.
csv, jsonl Response
Streamed CSV or JSONL payload.
The response is of type string.