API referenceEndpointsUsage
usage.session
RPC usage.session · Scope read
AuthorizationBearer <token>
A Plane API key, pl_<env>_…. The key is the environment: everything it reads and writes is scoped to the environment it was minted in, and the two tenancy headers are ignored for one.
In: header
Header Parameters
x-plane-environment?string
The environment slug this request is about. Honoured only for a session cookie; ignored for an API key, whose environment is its identity.
x-plane-organization?string
The organization slug or id this request is about, resolved before the environment. Honoured only for a session cookie.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/usage/session" \ -H "Content-Type: application/json" \ -d '{ "id": "string" }'{ "sessionId": "string", "own": { "activeSeconds": 0, "inputTokens": 0, "outputTokens": 0, "cacheReadTokens": 0, "cacheWriteTokens": 0, "cacheReportingCalls": 0, "serverToolRequests": 0, "turns": 0, "modelCalls": 0, "toolCalls": 0, "costUsd": 0, "unpricedCalls": 0 }, "descendants": { "activeSeconds": 0, "inputTokens": 0, "outputTokens": 0, "cacheReadTokens": 0, "cacheWriteTokens": 0, "cacheReportingCalls": 0, "serverToolRequests": 0, "turns": 0, "modelCalls": 0, "toolCalls": 0, "costUsd": 0, "unpricedCalls": 0 }, "total": { "activeSeconds": 0, "inputTokens": 0, "outputTokens": 0, "cacheReadTokens": 0, "cacheWriteTokens": 0, "cacheReportingCalls": 0, "serverToolRequests": 0, "turns": 0, "modelCalls": 0, "toolCalls": 0, "costUsd": 0, "unpricedCalls": 0 }, "children": [ { "sessionId": "string", "agentId": "string", "subagentName": "string", "depth": 0, "totals": { "activeSeconds": 0, "inputTokens": 0, "outputTokens": 0, "cacheReadTokens": 0, "cacheWriteTokens": 0, "cacheReportingCalls": 0, "serverToolRequests": 0, "turns": 0, "modelCalls": 0, "toolCalls": 0, "costUsd": 0, "unpricedCalls": 0 } } ]}