GET
/v1/usage
Returns real-time usage statistics for the authenticated account, including request counts for the current billing period, a per-endpoint breakdown, entropy consumed, active API keys, and any overage charges accumulated.
Authentication
Requires an API key with the account:read scope.
Parameters
This endpoint accepts no parameters. Usage is always reported for the currently authenticated account and the current calendar-month billing period.
Code Examples
usage.py
from trueentropy import TrueEntropy
client = TrueEntropy(api_key="te_live_YOUR_KEY")
usage = client.usage()
print(f"Used {usage.requests.used} / {usage.requests.limit} ({usage.requests.percentage}%)")
usage.js
import { TrueEntropy } from '@trueentropy/sdk';
const client = new TrueEntropy('te_live_YOUR_KEY');
const usage = await client.usage();
console.log(usage.requests);
console.log(usage.endpoints);
usage.php
use TrueEntropy\Client;
$client = new Client('te_live_YOUR_KEY');
$usage = $client->usage();
echo $usage->requests->used;
Terminal
curl https://api.trueentropy.net/v1/usage \
-H "Authorization: Bearer te_live_YOUR_KEY"
Response
200 OKJSON
{
"data": {
"current_period": {
"start": "2026-04-01T00:00:00Z",
"end": "2026-04-30T23:59:59Z",
"reset": "2026-05-01T00:00:00Z"
},
"tier": "pro",
"requests": {
"used": 42318,
"limit": 500000,
"remaining": 457682,
"percentage": 8.46
},
"endpoints": {
"integers": 28412,
"bytes": 9801,
"uuid": 2890,
"batch": 1215
},
"entropy_consumed": {
"total_bits": 18472960,
"total_bytes": 2309120
},
"keys": {
"active": 3,
"limit": 10
},
"overage": {
"additional_requests": 0,
"estimated_cost": "£0.00"
}
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
current_period.start | string (ISO 8601) | Start of the current billing period (UTC) |
current_period.end | string (ISO 8601) | End of the current billing period (UTC) |
current_period.reset | string (ISO 8601) | When counters reset (first of next month, UTC) |
tier | string | One of free, developer, pro, business, enterprise |
requests.used | integer | Total requests this period |
requests.limit | integer or "unlimited" | Monthly limit for the current tier |
requests.remaining | integer or "unlimited" | Remaining requests before overage |
requests.percentage | number | Percentage of monthly limit used (0-100+) |
endpoints | object | Per-endpoint request count (integers, bytes, uuid, etc.) |
entropy_consumed.total_bits | integer | Total raw entropy bits delivered to this account this period |
entropy_consumed.total_bytes | integer | Ceiling of bits / 8 |
keys.active | integer | Number of active API keys on the account |
keys.limit | integer | Max API keys allowed by tier (free: 2, developer: 5, pro: 10, business: 25, enterprise: 100) |
overage.additional_requests | integer | Requests beyond the monthly limit (paid tiers only) |
overage.estimated_cost | string | Overage cost in GBP at £0.0001 per additional request |
Errors
| Status | Code | Description |
|---|---|---|
| 401 | auth_missing | No API key provided |
| 401 | auth_invalid | API key is invalid or revoked |
| 403 | scope_missing | API key lacks account:read scope |
| 429 | rate_limited | Rate limit exceeded |
Best Practices
- Don't poll aggressively - Cache usage data for at least 60 seconds; values update in near-real-time but do not change each request
- Use webhooks for alerts - Configure rate-limit webhooks at 80 / 90 / 100% thresholds rather than polling
- Monitor overage - If
overage.additional_requestsis non-zero, you are in paid overage - consider upgrading tier