Skip to content

Usage API

2 operationsusage:read

Requests and billed units by day, route, API token or your own client reference, for up to 90 days at a time, plus a log of every call.

GET/usageSum requests and billed units over a time window, by day, route, client reference or API key.
GET/usage/logsList the account's API calls, newest first, by key, route or outcome.

Sum requests and billed units over a time window, by day, route, client reference or API key.

GET/v1/usage
scope usage:read

Parameters

from
integer
required
to
integer
required
groupBy
string
clientRef
string
tokenId
string

Response

4 fields
resultsUsageBucket[]
keystring
requestsinteger (int64)
unitsinteger (int64)
curl "https://api.hoshime.com/v1/usage?from=1&to=1" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "results": [
    {
      "key": "…",
      "requests": 0,
      "units": 0
    }
  ]
}

List the account's API calls, newest first, by key, route or outcome.

GET/v1/usage/logs
scope usage:read

Parameters

tokenId
string
route
string
status
string
cursor
string
limit
integer

Response

15 fields
hasMoreboolean
nextCursorstring
resultsUsageEvent[]
accountIdstring
clientRefstring
createdAtinteger (int64)
latencyMsinteger (int32)
methodstring
requestIdstring
routestring
scopestring
statusCodeinteger (int32)
tokenIdstring
ttlinteger (int64)
unitsinteger (int32)
curl "https://api.hoshime.com/v1/usage/logs" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "hasMore": false,
  "nextCursor": "…",
  "results": [
    {
      "accountId": "abc123",
      "clientRef": "…",
      "createdAt": 0,
      "latencyMs": 0,
      "method": "…",
      "requestId": "abc123",
      "route": "…",
      "scope": "…",
      "statusCode": 0,
      "tokenId": "abc123",
      "ttl": 0,
      "units": 0
    }
  ]
}
esc
↑↓ move↵ open