GET/api/gateway/usage/daily

Get grouped daily usage

API keys must pass scope=org (the default self is a signed-in member's own usage and answers 400 for a key). Requests include pre-dispatch refusals. Money is integer nano-USD.

認証: AuthorizationヘッダーにBearer形式のAPIキー

クエリパラメータ

  • org_idstring必須

    Your organization id. Required (this route takes it as a query parameter).

  • scopeenum

    self (signed-in member only) or org.

    "self""org"
    デフォルト: "self"
  • user_idstring

    With scope=org, restrict to one member (uuid).

  • fromstring

    First day, inclusive (YYYY-MM-DD, in time_zone).

  • tostring

    Last day, inclusive (YYYY-MM-DD).

  • group_byenum

    Grouping. hour and hour_model need both from and to, at most 7 days apart.

    "day""day_model""model""member""hour""hour_model"
    デフォルト: "day"
  • limitinteger

    Row cap, clamped to 1..2000 (1..24000 for day_model and hour_model).

    デフォルト: 400
  • time_zonestring

    IANA zone for day boundaries.

    デフォルト: "UTC"

レスポンス

  • 200

    Usage rows.

    レスポンス
    • org_idstring必須
    • scopeenum必須
      "self""org"
    • group_byenum必須
      "day""day_model""model""member""hour""hour_model"
    • rowsarray<object>必須
      rows
      • daystring | null必須

        Viewer-local day on day, day_model and member/model groupings that carry it; null on hour groupings.

      • hourstring | null

        Start instant of the UTC hour bucket on hour and hour_model; absent or null otherwise.

      • user_idstring | null必須

        Member id on group_by=member; null otherwise, and null for members of a deleted organization.

      • aliasstring | null必須

        Model slug on model, day_model and hour_model.

      • requestsinteger必須

        Requests in the bucket, pre-dispatch refusals included.

      • input_tokensinteger必須
      • output_tokensinteger必須
      • spend_nano_usdinteger必須

        Charged plus the BYOK list-price estimate, integer nano-USD (1 USD = 1,000,000,000).

      • paid_nano_usdinteger必須

        The charged part alone (credits actually debited), integer nano-USD.

      • free_nano_usdinteger必須

        List-price value of usage you were not charged for (promotion-funded plus waived discount), integer nano-USD. Not part of spend_nano_usd.

  • 400

    Bad date, zone, member id, hour window, or scope=self from a key.

    レスポンス
    • errorstring必須

      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.

    レスポンス
    • errorstring必須

      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

    Unknown organization, or not the key's own organization.

    レスポンス
    • errorstring必須

      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).

  • 429

    The analytics read slots are busy.

    レスポンス
    • errorstring必須

      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

    Usage analytics are temporarily unavailable. Retry shortly.

    レスポンス
    • errorstring必須

      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).

リクエスト

curl https://api.experientiallabs.ai/api/gateway/usage/daily?org_id=3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10&scope=org&user_id=7a2e9c14-0b3d-4f61-8c25-9e4d1a6b0f72&from=2026-11-01&to=2026-11-18&group_by=day&limit=400&time_zone=America%2FNew_York \
  -H "Authorization: Bearer YOUR_API_KEY"

レスポンス

{
  "org_id": "3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10",
  "scope": "org",
  "group_by": "day",
  "rows": [
    {
      "day": "2026-11-18",
      "hour": null,
      "user_id": null,
      "alias": null,
      "requests": 1842,
      "input_tokens": 9120344,
      "output_tokens": 612090,
      "spend_nano_usd": 14273500000,
      "paid_nano_usd": 11020000000,
      "free_nano_usd": 850000000
    },
    {
      "day": "2026-11-17",
      "hour": null,
      "user_id": null,
      "alias": null,
      "requests": 1610,
      "input_tokens": 7804112,
      "output_tokens": 540311,
      "spend_nano_usd": 12001200000,
      "paid_nano_usd": 9800500000,
      "free_nano_usd": 0
    }
  ]
}

https://api.experientiallabs.ai/api/gateway/usage/daily?org_id=3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10&scope=org&user_id=7a2e9c14-0b3d-4f61-8c25-9e4d1a6b0f72&from=2026-11-01&to=2026-11-18&group_by=day&limit=400&time_zone=America%2FNew_York