Inspect

Get session subagent cost

Return the token totals and cost of a subagent of the session, including its own subagents. `sessionId` is the subagent ID and messageCount is always 0. Returns 404 when the subagent does not belong to the session.

Base URL
GET
/api/public/v1/sessions/{session_id}/subagents/{subagent_id}/cost

Return the token totals and cost of a subagent of the session, including its own subagents. sessionId is the subagent ID and messageCount is always 0. Returns 404 when the subagent does not belong to the session.

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

session_id*string

The unique identifier of the session

subagent_id*string

The unique identifier of a subagent of the session

Response Body

Latest session cost and token totals

application/json
  1. response
data*
Example Request
curl -X GET 'https://your-org.inspect.com/api/public/v1/sessions/string/subagents/string/cost'
Example Response
{  "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"  }}