v52

latestOpenAPI 3.1.1raw.githubusercontent.com2026-08-06146175447.7 KB
Session

Get session usage

Aggregate token and cost usage across the session and all its descendant subagents. Resolves the tree root, so the result is the same whether a parent or child session ID is passed.

get/session/{sessionID}/usage

Path parameters

sessionIDstring required

Query parameters

directorystring

Response

Aggregated usage

rootIDstring required
totalCostnumber required
totalTokensnumber required
sessionCountnumber required