Organisations
Read an organisation's usage
The organisation's calls with its keys and connected agents: today, this month, the last 31 days, by what they did and how they came.
GET
/orgs/{org}/usageTL;DR
| Question | Answer |
|---|---|
| What does it do? | Read an organisation's usage. |
| What does it take? | org in the path. |
| What does it return? | Status 200 with a body of type OrgUsage. |
| What can go wrong? | 401 not signed in, or the key is not valid; 404 no such organisation, the caller is not a member of it, or the key is another organisation's; 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope. |
What it does
The organisation's calls with its keys and connected agents: today, this month, the last 31 days, by what they did and how they came. Every member. The owner, admins and the people the owner chose also get the calls by member and agent.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
org | string | yes | The organisation's id or its slug. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The usage. | OrgUsage |
| 401 | Not signed in, or the key is not valid. | ErrorResponse |
| 404 | No such organisation, the caller is not a member of it, or the key is another organisation's. | ErrorResponse |
| 429 | Too many requests. | ErrorResponse |
| 503 | Organisations are not set up on this server. | ErrorResponse |
Response body
A 200 answer has the type OrgUsage.
| Field | Type | Required | Description |
|---|---|---|---|
available | boolean | yes | False when the call history is not set up on this server, or could not be read; the figures are then zero. |
retentionDays | integer | yes | |
today | integer | yes | Calls today, UTC. |
month | integer | yes | Calls this calendar month, UTC. |
days | object[] | yes | The last 31 UTC days, oldest first. |
days[].day | string | yes | |
days[].connection | integer | yes | |
days[].key | integer | yes | |
groups | object[] | yes | This month's calls by what they did. |
groups[].group | "draw" | "import" | "publish" | "library" | "check" | "icons" | "docs" | "help" | yes | |
groups[].calls | integer | yes | |
via | object | yes | This month's calls by how they came. |
via.connection | integer | yes | |
via.key | integer | yes | |
canReadCalls | boolean | yes | Whether the caller may read every member's calls. |
canExport | boolean | yes | |
breakdown | object | null | yes | Calls of the last 90 days by member and by agent or key, for a caller who may read the history; null for anyone else. |
breakdown.members | object[] | yes | |
breakdown.members[].userId | string | yes | |
breakdown.members[].email | string | null | yes | |
breakdown.members[].calls | integer | yes | |
breakdown.members[].lastAt | number | yes | |
breakdown.agents | object[] | yes | |
breakdown.agents[].keyId | string | yes | |
breakdown.agents[].via | "connection" | "key" | yes | |
breakdown.agents[].name | string | null | yes | |
breakdown.agents[].member | object | null | yes | |
breakdown.agents[].calls | integer | yes | |
breakdown.agents[].lastAt | number | yes |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint, and the error envelope |
| Schemas | Every request and response type |
| Tool reference | The operations as callable tools |