Report an org's estimated translation token usage and per-table database byte usage.
Report a WorkOS org's estimated translation token usage (by language) and per-table database byte usage.
Auth: Bearer JWT (WorkOS).
| Param | Type | Required | Notes |
|---|---|---|---|
orgId | uuid | yes | The WorkOS organization to report on. |
{
"orgId": "...",
"translations": {
"translations": 120,
"estimatedPromptTokens": 45000,
"estimatedCompletionTokens": 42000,
"estimatedTotalTokens": 87000,
"byLanguage": [
{
"language": "fr",
"translations": 40,
"estimated_prompt_tokens": 15000,
"estimated_completion_tokens": 14000,
"estimated_total_tokens": 29000
}
],
"note": "..."
},
"database": {
"totalBytes": 1048576,
"totalHuman": "1.0 MB",
"byTable": [ { "table": "documents", "rows": 42, "bytes": 500000 } ],
"note": "..."
}
}
Token counts are estimates (a ~4-chars-per-token heuristic plus a fixed per-call system-prompt allowance), not the provider's billed usage. Database usage sums pg_column_size per owned table; image binaries stored in object storage are not counted. Note the serde quirk: inside byLanguage the token keys are snake_case (estimated_prompt_tokens, etc.) while the parent object uses camelCase.
curl '{CMS_API_URL}/usage?orgId=<uuid>' \
-H 'Authorization: Bearer <workos-jwt>'
400 β missing or invalid orgId401 β missing or invalid JWT500 β query failure