Retrieve Trace For Run
runs.trace.retrieve(strrun_id, TraceRetrieveParams**kwargs) -> TraceRetrieveResponse
/v1/runs/{run_id}/trace
Retrieve OTEL trace spans for a run.
Returns a filtered set of spans relevant for observability:
- agent_step: Individual agent reasoning steps
- tool executions: Tool call spans
- Root span: The top-level request span
- time_to_first_token: TTFT measurement span
Requires ClickHouse to be configured for trace storage.
Parameters
run_id: str
Returns
List[Dict[str, object]]
Retrieve Trace For Run
import os
from letta_client import Letta
client = Letta(
api_key=os.environ.get("LETTA_API_KEY"), # This is the default and can be omitted
)
traces = client.runs.trace.retrieve(
run_id="run_id",
)
print(traces)
[
{
"foo": "bar"
}
]
Returns Examples
[
{
"foo": "bar"
}
]