Skip to main content

Check an entitlement

POST /v1/usage/check evaluates the customer's current plan, overrides, quota, credits, and overage policy without recording usage.

curl --request POST https://api.usagey.com/v1/usage/check \
--header "Authorization: Bearer $USAGEY_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"externalId": "cus_9f2a",
"feature": "api_requests",
"quantity": 1
}'

Request body​

FieldTypeRequiredDescription
customerIdstringConditionalUsagey customer ID
externalIdstringConditionalStable ID from your application
emailstringConditionalCustomer email fallback
featurestringYesFeature key
quantitypositive integerNoDefaults to 1
sourcestringNoCaller label; defaults to api

Provide at least one customer selector. Prefer customerId or externalId over email.

{
"status": "access_granted",
"customerId": "cm123",
"featureId": "cm456",
"subscriptionId": "cm789",
"quantity": 1,
"currentUsage": 420,
"limit": 2000,
"remaining": 1579,
"creditsRemaining": null,
"overage": null
}

Call this endpoint before expensive or irreversible work. A successful check does not reserve capacity, so the subsequent track call remains authoritative under concurrency.