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): id, trace_id, name, type, model, duration_ms, prompt_tokens, completion_tokens, cost_usd, span_output, trace_output, error, created_at. span_output is
the span’s own output payload; trace_output is the parent
trace’s output payload joined onto every span row so a single
download carries both.
JSONL emits one JSON object per line with the same keys.
The Content-Disposition filename is
spans-<trace-prefix>-YYYY-MM-DD.{csv,jsonl}.
Documentation Index
Fetch the complete documentation index at: https://docs.trulayer.ai/llms.txt
Use this file to discover all available pages before exploring further.
SDK API key (tl_...) or Clerk session JWT
Trace to export spans for. Required — the endpoint returns 400 if absent.
csv, jsonl Streamed CSV or JSONL payload.
The response is of type string.