Project usage
This resource is a one-call summary of how much of the project exists: the plan it runs on, and how many team members, keys, files and events it holds. It is the counterpart to Quota and token usage, which reports what the project may still spend.
Endpoints
| Method | Path | Scope |
|---|---|---|
| GET | /v1/usage | usage:read |
The endpoint takes no parameters.
Read the usage
curl https://api.thinkhx.com/v1/usage \
-H "Authorization: Bearer sk-project-YOUR_KEY" {
"code": 200,
"title": "OK",
"response": {
"object": "usage",
"plan": {
"id": "plan_0664fc57b92acb9124be",
"name": "Starter"
},
"counts": {
"team_members": 4,
"api_keys": 3,
"files": 11,
"events": 842
}
}
} The usage object
| Field | Type | Description |
|---|---|---|
object | string | Always usage. |
plan | object | The plan the project runs on, as id and name, or null. |
counts | object | The project's totals. See below. |
counts
| Field | Type | Description |
|---|---|---|
team_members | integer | Members currently attached to the project. |
api_keys | integer | Keys that still authenticate. |
files | integer | Files the project holds. |
events | integer | Entries in the project's audit trail. |
These are live totals of what exists now, not counters that accumulate: revoking a key lowers api_keys, and deleting a file lowers files. events is the exception and only ever rises, because an event is never removed.
Note —
planisnullwhen the project is not on a plan. The counts are still returned, so treat the two parts of the response independently.
The counts here overlap with what the individual resources report: events counts the whole trail even though Events lists only the 100 most recent, and api_keys counts the same keys API keys enumerates.