Skip to Content
Orbyte Labs

Check usage

POST
/v1/check

Read-only feature access and balance check. Unknown identities preview the sum of customer.created grant policies listing this feature without creating records. Only unexpired, unexhausted grants listing this feature contribute to availableCredits. Subscription grants also require an active or trialing subscription before its access expiry; purchased grants work independently. The feature must exist in the environment's active, ready deployment. For a distinct feature, supply the configured grouping field in payload. The first distinct use needs funds for one unit, and an already counted use needs only a positive matching balance. Count features always require funds for one event at the deployed price. minimumBalance is optional; a positive matching balance is always required, including for zero-cost features. Credit amounts use decimal strings in JSON. Denials return 200 with allowed: false and a reason. No credits are reserved: tracking calculates the actual event charge and checks funds atomically. Refresh at nextChangeAt to account for expiry or rollover.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Environment API key or OAuth access token. OAuth requests select context with X-Orbyte-Environment or X-Orbyte-Organization when required by the operation.

Header Parameters

X-Orbyte-Environment?string

Required for environment-scoped OAuth operations. API keys remain bound to their own environment.

Length1 <= length

Request Body

application/json
  1. body
identity*string
Length1 <= length <= 128
featureKey*string
Match^[a-z][a-z0-9_-]*$
Length1 <= length <= 128
payload?
minimumBalance?string
Match^-?(0|[1-9][0-9]*)$
Lengthlength <= 20

Response Body

Current eligibility and available credits

application/json
  1. response
availableCredits*string
Match^-?(0|[1-9][0-9]*)$
Lengthlength <= 20
asOf*number

Server time in milliseconds when the balance was calculated.

nextChangeAt?number

Next expiry or rollover boundary in milliseconds. Refresh the balance then.

allowed*boolean
reason?string
Value in"feature_unavailable""insufficient_credits"
Example Request
curl -X POST 'https://api.orbytelabs.com/v1/check' \  -H 'Content-Type: application/json' \  -d '{  "identity": "string",  "featureKey": "string"}'
Example Response
{  "availableCredits": "string",  "asOf": 0,  "nextChangeAt": 0,  "allowed": true,  "reason": "feature_unavailable"}