Skip to content
Platform documentation
Entitlement API
API reference

Entitlement API

Check access and consume already-paid service credits.

GET /v1/check

Query parameters: feature and holder. Returns an access view. A successful HTTP response does not by itself mean access is enabled; inspect enabled.

json
{
  "feature": "ocr",
  "enabled": true,
  "remaining": "9",
  "paid_through": "2030-01-01T00:00:00.000Z",
  "renewal_enabled": true
}

This is a shortened example response, not a grant issued by the documentation. Exact balances and dates come from your deployment.

GET /v1/entitlements

Provide holder and an optional feature filter. Returns entitlements and living grants for that holder, subject to credential scope.

POST /v1/usage/consume

json
{
  "feature": "ocr",
  "holder": "customer-123",
  "amount": "1",
  "idempotencyKey": "document-job-123"
}

Requires a secret key or a customer token with the matching holder. A publishable key cannot mutate usage. An optional grant_id selects a specific grant, which must cover the requested holder and feature. Returns entitlement and grant state. Prepaid consumption does not require a USDC mandate.

POST /v1/access-tokens

Secret-key only. Your backend authenticates the customer and supplies holder plus optional expiresIn, up to 3600 seconds. The response includes token, holder, and expires_in.

json
{ "holder": "customer-123", "email": "customer@example.com", "expiresIn": 900 }

POST /v1/entitlements/:id/cancel-renewal

Use an authorized secret or holder-scoped customer token. For a subscription-backed grant this returns a payer-wallet cancellation draft; approve it and sync the subscription. A server flag alone cannot cancel collection. For other grants it updates renewal_enabled. Already-paid time remains subject to expiry and remaining credits.

Bagseven documentationemail and wallet · Avalanche · Registry