مواد پر جائیں
AtheronDEVELOPERS
← API reference

Developer API: usage

Calls, errors and latency per day and bucket for your key's environment.

مثالوں میں اپنی ٹیسٹ کلائنٹ آئی ڈی دیکھنے کے لیے سائن اِن کریں۔

GET https://developers.aton-network.org/api/v1/usage

When to use it

In your own dashboards and alerts, for example to warn before you reach a daily limit.

Authentication

Authorization: Bearer <API key> with the usage:read right.

Parameters

NameInTypeRequiredLimitsWhat it is
AuthorizationheaderstringyesAn API key with usage:read.
daysqueryintegerno1 to 90, default 7How many days back, today included.

Request

# Calls, errors and latency per day and bucket, for the last seven days. Needs usage:read.
curl "https://developers.aton-network.org/api/v1/usage?days=7" \
  -H "Authorization: Bearer $ATHERON_API_KEY"

In GraphQL

Query.usage at POST https://developers.aton-network.org/api/graphql, with the usage:read right, costing 1. Calls, errors and latency per day and bucket for the key's environment, 1 to 90 days (anything else is brought within, as REST does).

Variables:

The answer:

Errors it can meet: invalid_key, missing_right, rate_limited, server_error. Try it in the GraphQL playground.

graphql
query Usage($days: Int = 7) {
  usage(days: $days) {
    env
    days
    usage {
      day
      bucket
      calls
      errors
      msAvg
      msMax
    }
  }
}
json
{
  "days": 7
}
json
{
  "data": {
    "usage": {
      "env": "TEST",
      "days": 7,
      "usage": [
        {
          "day": "2026-10-14",
          "bucket": "token",
          "calls": 42,
          "errors": 1,
          "msAvg": 38,
          "msMax": 210
        }
      ]
    }
  },
  "extensions": {
    "cost": 1
  }
}

Response

http
HTTP 200
content-type: application/json

{
  "env": "live",
  "days": 7,
  "usage": [
    { "day": "2026-10-14", "bucket": "token", "calls": 1203, "errors": 4, "ms_avg": 38, "ms_max": 412 },
    { "day": "2026-10-14", "bucket": "userinfo", "calls": 2210, "errors": 0, "ms_avg": 22, "ms_max": 190 }
  ]
}

Errors

HTTPerrorCauseFix
401invalid_keyNo API key was sent, or it is not one of ours, expired or revoked.Send Authorization: Bearer with a key from the app's API keys page.
403missing_rightThe key does not carry the right this call needs.Make a key with the right (app:read or usage:read).
429rate_limitedOver your quota for this bucket, this minute or this day.Wait the Retry-After seconds. Requests over the limit still count, so a retry loop keeps you over it.
500server_errorSomething went wrong at our end.Try again in a moment. If it keeps happening, check the status page and tell us in the chat.

Good to know

  • A day with no calls in a bucket is left out rather than listed as zero.

Security

  • Never put an API key in a URL or in code that ships to a browser.

⁨Atlas⁩ سے پوچھیں

AI اسسٹنٹ

Atheron کے ساتھ سائن ان، API یا پورٹل کے بارے میں کچھ بھی پوچھیں۔ جواب ہماری دستاویزات سے آتا ہے، استعمال شدہ صفحات کے لنک کے ساتھ۔