Usage breakdown by model
GET
/api/workspaces/{workspaceId}/usage/by-model
const url = 'http://localhost:8080/api/workspaces/example/usage/by-model';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/by-model \ --cookie auth_session=<auth_session>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”Per-model usage breakdown.
Media typeapplication/json
object
models
required
Array
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
modelId
required
string | null
Example generated
{ "models": [ { "totalInputTokens": 1, "totalOutputTokens": 1, "totalCacheReadTokens": 1, "totalCacheWriteTokens": 1, "totalReasoningTokens": 1, "totalTokens": 1, "totalCostUsd": 1, "invocationCount": 1, "modelId": "example" } ]}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"}