Skip to Content
APIEndpointsGet API usage

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/usage

Authorization

HeaderTypeRequired
AuthorizationBearer asky_sk_…required

Query parameters

ParameterTypeRequiredDescription
daysintegeroptionalDays 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 --request GET \ --url 'https://api.askylabs.com/v1/usage' \ --header 'Authorization: Bearer <api-key>'

Response

{ "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

FieldTypeDescription
data.periodobjectrequired
data.totalsobjectrequired. { requests, errors, p95_ms }
data.keysobject[]required. Per key: api_key_id, key_hint, requests, errors, p95_ms
data.by_endpointobject[]required
data.by_dayobject[]required. { day, requests, errors }
data.rate_limitobjectrequired. Current budget: { limit, remaining, reset }
request_idstringrequired. Also returned as the x-request-id header. Quote it when contacting support

Errors

StatusCodeWhen
400invalid_requestA parameter is unknown or malformed. The message names it
401invalid_tokenThe key is missing, malformed, or does not exist
401token_expiredThe key passed its expiry date
401token_revokedThe key was revoked
429rate_limitedOver 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.

Last updated on