Skip to content

Usage breakdown by user

GET
/api/workspaces/{workspaceId}/usage/by-user
curl --request GET \
--url http://localhost:8080/api/workspaces/example/usage/by-user \
--cookie auth_session=<auth_session>
workspaceId
required
string
from
string
to
string

Per-user usage breakdown.

Media typeapplication/json
object
users
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
userId
required
string | null

Example generated

{
"users": [
{
"totalInputTokens": 1,
"totalOutputTokens": 1,
"totalCacheReadTokens": 1,
"totalCacheWriteTokens": 1,
"totalReasoningTokens": 1,
"totalTokens": 1,
"totalCostUsd": 1,
"invocationCount": 1,
"userId": "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"
}