Read Thread usage
Read persisted model usage through the same Thread handle. Usage remains available while Session records exist; missing measurements are null.
/threads/{threadId}/usageRead persisted model usage through the same Thread handle. Usage remains available while Session records exist; missing measurements are null. Costs reported by runtimes are estimates, not invoices. Re-read earlier pages to refresh in-progress observations.
Authorization
publicApiBearer Use Authorization: Bearer msp_... . Project API keys can configure Agents, execute Sessions, and access files only in their Project. Key and account management require console or CLI login. Legacy account tokens are rejected.
In: header
Path Parameters
Thread ID returned by create thread. v1 IDs are bare ULIDs.
^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$ulidQuery Parameters
Maximum usage observations per page.
1 <= value <= 1000100The nextCursor returned by the previous page.
^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$ulidResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/threads/01J00000000000000000000009/usage"{ "nextCursor": "string", "usage": [ { "id": "string", "runId": "string", "provider": "string", "model": "string", "status": "started", "inputTokens": 0, "outputTokens": 0, "cacheReadTokens": 0, "cacheCreationTokens": 0, "reportedCostUsd": 0, "usageContract": "string" } ]}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}