GET/api/v1/key

Get the presented key's usage and limit

Self-lookup of the key on the request. Spend figures are the key's charged spend in USD (what draws credits). limit_remaining is measured in the cap's own UTC window (limit_reset). A read that crosses its time budget answers 503 with Retry-After; poll again after that many seconds.

Authentication: Bearer API key in the Authorization header

Responses

  • 200

    The presented key's info.

    Response
    • dataobjectrequired
      data
      • labelstringrequired

        The key's name.

      • usagenumberrequired

        Lifetime charged spend, USD.

      • limitnumber | nullrequired

        Spend cap in USD; null when uncapped.

      • limit_remainingnumber | nullrequired

        Cap less this window's spend and in-flight reservations, USD; null when uncapped.

      • limit_resetenum | nullrequired
      • is_free_tierbooleanrequired
      • usage_dailynumberrequired

        Charged spend this UTC day, USD.

      • usage_weeklynumberrequired

        Charged spend this UTC week, USD.

      • usage_monthlynumberrequired

        Charged spend this UTC month, USD.

  • 400

    The credential is not an API key (a browser session has no current key).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    The resource does not exist or belongs to another organization.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 503

    The usage read crossed its time budget; retry after Retry-After seconds.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

Request

curl https://api.experientiallabs.ai/api/v1/key \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "data": {
    "label": "billing-sync",
    "usage": 18.204113,
    "limit": 50,
    "limit_remaining": 47.25,
    "limit_reset": "daily",
    "is_free_tier": false,
    "usage_daily": 2.75,
    "usage_weekly": 9.81,
    "usage_monthly": 18.204113
  }
}

https://api.experientiallabs.ai/api/v1/key