Inspect

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.

Base URL
GET
/api/v2/sessions/{session_id}/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.

Authorization

bearerAuth sessions:read
headerAuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

Scope: sessions:read

Path Parameters

session_id*string

The unique identifier of the session

Response Body

Latest session cost and token totals

application/json
  1. response
data*
Example Request
curl -X GET 'https://app.inspect.com/api/v2/sessions/h2k9x4m7q1pd/cost'
Example Response
{  "data": {    "session_id": "h2k9x4m7q1pd",    "message_count": 0,    "total_input_tokens": 1284530,    "total_output_tokens": 38214,    "total_reasoning_tokens": 12907,    "total_cache_read_tokens": 1102345,    "total_cache_write_tokens": 96410,    "total_tokens": 1322744,    "total_cost": 4.82,    "updated_at": "2026-10-28T16:07:46.302Z"  }}