Get API usage
Your own API consumption, broken down per key, per endpoint and per day. The same figures the Usage panel in Settings renders.
This is API request usage, which is distinct from product credit consumption — API calls do not consume credits. For the credit balance see Credits.
GET /v1/usageAuthorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
days | integer | optional | Days of history, 1 to 400. Defaults to 30. Successful requests are retained for 90 days and failures for 400, so a window past 90 days shows errors more completely than successes. |
Request
cURL
curl --request GET \
--url 'https://api.askylabs.com/v1/usage' \
--header 'Authorization: Bearer <api-key>'Response
200
{
"data": {
"period": { "start_date": "2026-07-14", "end_date": "2026-08-13" },
"totals": { "requests": 4820, "errors": 31, "p95_ms": 212 },
"keys": [
{ "api_key_id": "6e3fbbff-4230-421f-ae3a-3d4d63a83f10", "key_hint": "asky_sk_…gxSN", "requests": 4820, "errors": 31, "p95_ms": 212 }
],
"by_endpoint": [
{ "endpoint": "asky_brands_list", "requests": 1204, "errors": 0, "p95_ms": 118 }
],
"by_day": [
{ "day": "2026-08-13", "requests": 214, "errors": 2 }
],
"rate_limit": { "limit": 300, "remaining": 299, "reset": 25 }
},
"request_id": "req_39ae1c78f0b2456d8e14"
}Response fields
| Field | Type | Description |
|---|---|---|
data.period | object | required |
data.totals | object | required. { requests, errors, p95_ms } |
data.keys | object[] | required. Per key: api_key_id, key_hint, requests, errors, p95_ms |
data.by_endpoint | object[] | required |
data.by_day | object[] | required. { day, requests, errors } |
data.rate_limit | object | required. Current budget: { limit, remaining, reset } |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A parameter is unknown or malformed. The message names it |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 429 | rate_limited | Over 300 requests per minute. See the Retry-After header |
Notes
Figures are live, not batched. A call made seconds ago is already counted, so this is safe to use as confirmation that an integration is working rather than waiting for an hourly rollup.
Rejected requests count too. A 401 from an expired key, a 429, or a 400 from a bad parameter all appear here. A key that has stopped working shows up as errors rather than as silence, which is the point.
Errors are split into client-caused and server-caused in the Settings panel. A 4xx is your request; a 5xx is ours.