Get subscription usage

Returns a live projection of the current billing period together with summaries of past periods for the subscription. Non-usage subscriptions return isUsageBased: false. Requires the USAGE_READ scope.

GET https://api.pandabase.io/v2/core/stores/{storeId}/subscriptions/{subscriptionId}/usage

Authentication

Requires a bearer token (sk_…) or an API key in the header Authorization.

Path parameters

storeId string required

(length 12–48)

subscriptionId string required

(length 12–48)

Header parameters

idempotency-key string

(length 8–32)

Response 200

Default Response

ok enum required

(one of true)

data object required

No description.

Response 404

Default Response

ok enum required

(one of false)

error string required

No description.

Request
curl -X GET https://api.pandabase.io/v2/core/stores/:storeId/subscriptions/:subscriptionId/usage
Response
{  "ok": true,  "data": {    "subscriptionId": "sub_8h4t6sqzy3x9w5n2k1m0vqbf",    "isUsageBased": true,    "currency": "USD",    "currentPeriod": {      "periodStart": "2026-05-01T00:00:00.000Z",      "periodEnd": "2026-06-01T00:00:00.000Z",      "baseAmount": 0,      "usageAmount": 1970,      "projectedTotal": 1970,      "meters": [        {          "meterId": "umt_5e1q3npwt0u6s2k8h9j7rzbc",          "eventName": "input_tokens",          "quantity": 6566667,          "amountCharged": 1970        }      ]    },    "pastPeriods": [      {        "periodStart": "2026-04-01T00:00:00.000Z",        "periodEnd": "2026-05-01T00:00:00.000Z",        "totalCharged": 4500,        "orderId": "ord_p2v8q1mzj0kxw5h7n4tr3bcf",        "meters": [          {            "meterId": "umt_5e1q3npwt0u6s2k8h9j7rzbc",            "eventName": "input_tokens",            "quantity": 15000000,            "unitPrice": 300,            "unitQuantity": 1000000,            "amountCharged": 4500          }        ]      }    ]  }}