Alpha: The request and response contract may change; Compute aggregate stats for a single thread (turn count, latency percentiles, token/cost sums, and detail breakdowns) within a project.
stats(
threadID: string,
query: ThreadStatsParams,
options: RequestOptions
): APIPromise<ThreadStatsResponse>| Name | Type | Description |
|---|---|---|
threadID* | string | |
query* | ThreadStatsParams | |
options | RequestOptions |
const response = await client.threads.stats('thread_id', {
selects: ['TURNS'],
session_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
});