Query Single Thread Stats
Changed onCompute aggregate stats for a single thread (turn count, latency percentiles, token/cost sums, and detail breakdowns) within a project.
Self-hosted deployments require LangSmith v0.16 or later.
Request
- Base URLhttps://api.smith.langchain.com
- URLhttps://api.smith.langchain.com/api/v2/threads/{thread_id}/stats
- Auth
- API key in header X-API-Key and API key in header X-Tenant-Id
- or HTTP bearer and API key in header X-Tenant-Id
Path parameters
Thread ID
Query parameters
filter narrows which of the thread's traces are aggregated, using a LangSmith filter expression. For example: lt(start_time, "2025-01-01T00:00:00Z") or eq(trace_id, "0190a1b2-c3d4-7ef0-a5b6-6ea3a82e9328"). See https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language for syntax.
selects lists which aggregate stats to compute and return (repeatable query parameter). At least one value is required. Accepts any value of SingleThreadStatsSelectField.
session_id is the tracing project (session) UUID (required).
Response
aggregate stats for the thread
Changes
- info
endpoint added
- info