Thread の利用量を取得
同じ Thread から永続化されたモデル利用量を読み取ります。Session 記録が存在する限り利用量を取得でき、未報告値は null です。実行環境の費用は推定値であり請求額ではありません。実行中の観測を更新するには以前のページを再取得してください。
GET
/threads/{threadId}/usage同じ Thread から永続化されたモデル利用量を読み取ります。Session 記録が存在する限り利用量を取得でき、未報告値は null です。実行環境の費用は推定値であり請求額ではありません。実行中の観測を更新するには以前のページを再取得してください。
Authorization
publicApiBearer AuthorizationBearer <token>
Authorization: Bearer msp_... を使用します。Project API key は同じ Project の Agent 設定、Session 実行、ファイルアクセスに限定されます。キーと account の管理には console または CLI ログインが必要です。旧 account token は拒否されます。
In: header
Path Parameters
threadId*string
Thread 作成時に返された Thread ID。v1 ID は prefix のない ULID です。
Match
^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$Format
ulidQuery Parameters
limit?integer
一ページに含める利用量観測の最大数。
Range
1 <= value <= 1000Default
100after?string
前のページが返した nextCursor。
Match
^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$Format
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" }}