LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmith_openapi_clientresourcesthreadsThreadsaggregateStats
Method●Since v0.14

aggregateStats

GET 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.

Copy
aggregateStats(
  body: ThreadAggregateStatsParams,
  options: RequestOptions
): APIPromise<ThreadAggregateStatsResponse>

Parameters

NameTypeDescription
body*ThreadAggregateStatsParams
optionsRequestOptions

Example

Copy
const response = await client.threads.aggregateStats({
  project_id: '0190a1b2-c3d4-7ef0-a5b6-6ea3a82e9328',
  select: [
    'THREAD_COUNT',
    'TRACE_COUNT',
    'TOTAL_TOKENS',
    'TOTAL_COST',
  ],
});
View source on GitHub