Raportează utilizarea estimată a jetoanelor de traducere și utilizarea bazei de date în octeți pe tabel pentru o organizație.
Raportează utilizarea estimată a jetoanelor de traducere (pe limbă) și utilizarea bazei de date în octeți pe tabel pentru o organizație WorkOS.
Autentificare: Bearer JWT (WorkOS).
| Parametru | Tip | Obligatoriu | Note |
|---|---|---|---|
orgId | uuid | da | Organizația WorkOS pentru care se generează raportul. |
{
"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": "..."
}
}
Numărul de jetoane este estimativ (o euristică de aproximativ 4 caractere pe jeton, plus o alocație fixă pentru promptul de sistem per apel), nu reprezintă consumul facturat de furnizor. Utilizarea bazei de date însumează pg_column_size pentru fiecare tabel deținut; binarele de imagini stocate în stocarea de obiecte nu sunt luate în calcul. Observă particularitatea de serializare: în byLanguage, cheile pentru jetoane sunt în snake_case (estimated_prompt_tokens etc.), în timp ce obiectul părinte folosește camelCase.
curl '{CMS_API_URL}/usage?orgId=<uuid>' \
-H 'Authorization: Bearer <workos-jwt>'
400 — orgId lipsă sau invalid401 — JWT lipsă sau invalid500 — eșec al interogării