Workspace usage summary
GET
/api/workspaces/{workspaceId}/usage/summary
const url = 'http://localhost:8080/api/workspaces/example/usage/summary';const options = {method: 'GET', headers: {cookie: 'auth_session=<auth_session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:8080/api/workspaces/example/usage/summary \ --cookie auth_session=<auth_session>Total tokens and cost for the workspace, optionally date-filtered.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workspaceId
required
string
Query Parameters
Section titled “Query Parameters”from
string
to
string
Responses
Section titled “Responses”Aggregate usage totals.
Media typeapplication/json
object
totalInputTokens
required
number
totalOutputTokens
required
number
totalCacheReadTokens
required
number
totalCacheWriteTokens
required
number
totalReasoningTokens
required
number
totalTokens
required
number
totalCostUsd
required
number
invocationCount
required
number
Example generated
{ "totalInputTokens": 1, "totalOutputTokens": 1, "totalCacheReadTokens": 1, "totalCacheWriteTokens": 1, "totalReasoningTokens": 1, "totalTokens": 1, "totalCostUsd": 1, "invocationCount": 1}Invalid request
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Authentication required
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Forbidden
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Not found
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Conflict
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}Internal server error
Media typeapplication/json
object
success
boolean
error
required
string
Example
{ "error": "Human-readable error message"}