Get session cost
Best-effort refresh the session durable-object export and return the latest persisted token totals and cost for a specific session. This can be used while a session is still running, without waiting for the scheduled export job. Laminar-runtime sessions return Laminar usage totals, including the usage of the session's subagents such as Verification agent runs, and messageCount is always 0 for them. Use GET /sessions/{session_id}/subagents/{subagent_id}/cost for a single subagent's usage. A Laminar-runtime session that was never bound to a Laminar session returns zero totals.
Best-effort refresh the session durable-object export and return the latest persisted token totals and cost for a specific session. This can be used while a session is still running, without waiting for the scheduled export job. Laminar-runtime sessions return Laminar usage totals, including the usage of the session's subagents such as Verification agent runs, and messageCount is always 0 for them. Use GET /sessions/{session_id}/subagents/{subagent_id}/cost for a single subagent's usage. A Laminar-runtime session that was never bound to a Laminar session returns zero totals.
bearerAuthAuthorizationBearer <token>API key authentication. Use your API key as the bearer token.
session_id*stringThe unique identifier of the session
Latest session cost and token totals
application/json- response
data*curl -X GET 'https://your-org.inspect.com/api/public/v1/sessions/string/cost'{ "data": { "sessionId": "string", "messageCount": 0, "totalInputTokens": 0, "totalOutputTokens": 0, "totalReasoningTokens": 0, "totalCacheReadTokens": 0, "totalCacheWriteTokens": 0, "totalTokens": 0, "totalCost": 0.1, "updatedAt": "2019-08-24T14:15:22Z" }}