threads
Query Thread Stats
Changed onGET with body payload — no resources created. Returns aggregate statistics for threads in a tracing project. The response includes the thread counts, run counts, latency percentiles, rates, token totals, and cost totals requested in select.
Self-hosted deployments require LangSmith v0.17 or later.
post/api/v2/threads/stats
Request
- Base URLhttps://api.smith.langchain.com
- URLhttps://api.smith.langchain.com/api/v2/threads/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
Request body
Example request
{
"filter": "eq(status, \"error\")",
"project_id": "0190a1b2-c3d4-7ef0-a5b6-6ea3a82e9328",
"select": [
"THREAD_COUNT",
"TRACE_COUNT",
"TOTAL_TOKENS",
"TOTAL_COST"
],
"thread_filter": "gte(turn_count, 3)",
"trace_filter": "eq(status, \"error\")",
"tree_filter": "has(tags, \"production\")"
}Response
aggregate thread statistics
Changes
- info
endpoint added
- info