Contract
- shape
- collection
- authority
- read
- evidence
- none
- subscription
- false
- permission
- any one of: org.admin (carried by the caller's role template in the org `org_id`); api_key.read (carried by the caller's role template in the org `org_id`); a deactivated caller is refused first
- idempotency
- safe
- emits
- none
- MCP tool
- get_api_usage
- REST
- POST https://api.containertradehq.com/v1/cap/get_api_usage
Idempotency: a read: calling again changes nothing
Inputs
| name | type | required | validation |
|---|---|---|---|
| org_id | org_id | required | tradehq-org-id; 1 to 20 characters The org whose keys they are. |
| key_id | text | optional | 1 to 12 characters One key's usage. Absent, every key's. |
| since | date | optional | date, YYYY-MM-DD The first UTC day, included. Defaults to 29 days before until. |
| until | date | optional | date, YYYY-MM-DD The last UTC day, included. Defaults to today. |
| mode | one_of | optional | one of live, test live or test: only the keys of that mode. Absent, both, each row naming its mode. |
Paginated: next next_after · ceiling not_declared
Response
items· object[]next_after· stringnull · Pass as `after` for the next page; null on the last one.
Full JSON Schema
{
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"day": {
"type": "string",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
"format": "date",
"description": "The UTC day.",
"x-data-class": "operational"
},
"key_id": {
"type": "string",
"description": "The key.",
"x-data-class": "operational"
},
"mode": {
"type": "string",
"enum": [
"live",
"test"
],
"description": "The key's mode.",
"x-data-class": "operational"
},
"requests": {
"type": "integer",
"description": "Requests served that day.",
"x-data-class": "operational"
},
"refused": {
"type": "integer",
"description": "Requests refused that day for passing a limit.",
"x-data-class": "operational"
}
},
"required": [
"day",
"key_id",
"mode",
"requests",
"refused"
],
"additionalProperties": false
}
},
"next_after": {
"type": [
"string",
"null"
],
"description": "Pass as `after` for the next page; null on the last one."
}
},
"required": [
"items",
"next_after"
],
"additionalProperties": false
} Refusals
not yet declared
The platform refusals apply to every call: version, authentication, authority, validation and rate limits, each in the same envelope.
Surfaces
- Voice: degraded: visualization
- Push: emits nothing
- OneBox: no document originates API usage
- Outbound: crosses to no counterparty
Events
None emitted.
Related
create_api_key, create_service_account, get_view_default, list_capability_events, list_saved_views, revoke_api_key, rotate_api_key, save_view, set_api_key_limits, set_api_key_version, set_my_view_default, set_org_view_default