Docs / API Reference / usage
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

FieldTypeDescription
current_period.startstring (ISO 8601)Start of the current billing period (UTC)
current_period.endstring (ISO 8601)End of the current billing period (UTC)
current_period.resetstring (ISO 8601)When counters reset (first of next month, UTC)
tierstringOne of free, developer, pro, business, enterprise
requests.usedintegerTotal requests this period
requests.limitinteger or "unlimited"Monthly limit for the current tier
requests.remaininginteger or "unlimited"Remaining requests before overage
requests.percentagenumberPercentage of monthly limit used (0-100+)
endpointsobjectPer-endpoint request count (integers, bytes, uuid, etc.)
entropy_consumed.total_bitsintegerTotal raw entropy bits delivered to this account this period
entropy_consumed.total_bytesintegerCeiling of bits / 8
keys.activeintegerNumber of active API keys on the account
keys.limitintegerMax API keys allowed by tier (free: 2, developer: 5, pro: 10, business: 25, enterprise: 100)
overage.additional_requestsintegerRequests beyond the monthly limit (paid tiers only)
overage.estimated_coststringOverage cost in GBP at £0.0001 per additional request

Errors

StatusCodeDescription
401auth_missingNo API key provided
401auth_invalidAPI key is invalid or revoked
403scope_missingAPI key lacks account:read scope
429rate_limitedRate 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_requests is non-zero, you are in paid overage - consider upgrading tier