mosoodocs

Read Thread usage

Read persisted model usage through the same Thread handle. Usage remains available while Session records exist; missing measurements are null.

GET/threads/{threadId}/usage

Read 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
AuthorizationBearer <token>

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

threadId*string

Thread ID returned by create thread. v1 IDs are bare ULIDs.

Match^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
Formatulid

Query Parameters

limit?integer

Maximum usage observations per page.

Range1 <= value <= 1000
Default100
after?string

The nextCursor returned by the previous page.

Match^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
Formatulid

Response 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"  }}