Usagey documentation
Build usage metering, entitlement checks, and billing workflows without maintaining the billing infrastructure yourself.
Explore Usagey
Start your integration
The shortest reliable path is to configure a sandbox workspace, model one entitlement, and test the check-and-track lifecycle.
1. Configure the workspace
Open the Usagey dashboard, select Sandbox, and configure your default currency, tax behavior, invoice profile, and payment provider.

2. Model access
Create these resources in order:
- A plan group, such as
primary-plan. - A plan, such as
Starter. - A metered feature with a stable key, such as
api_requests. - A plan entitlement that attaches the feature and its quota to the plan.
- A billable customer and an active subscription.
3. Create a sandbox API key
Create a key from Developer > API keys. Sandbox keys begin with usg_test_; production keys begin with usg_live_.
Use sandbox keys only with https://sandbox.usagey.com/v1 and live keys only with https://api.usagey.com/v1. Usagey rejects a key sent to the wrong environment host.
Never expose a Usagey API key in browser or mobile application code.
USAGEY_API_KEY=usg_test_replace_me
4. Check access
Call the check endpoint before expensive work runs:
curl --request POST https://sandbox.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
}'
5. Track successful usage
Record usage only after the operation succeeds. Reuse the same idempotency key when retrying the same event.
curl --request POST https://sandbox.usagey.com/v1/usage/track \
--header "Authorization: Bearer $USAGEY_API_KEY" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: request_01JEXAMPLE" \
--data '{
"externalId": "cus_9f2a",
"feature": "api_requests",
"quantity": 1,
"source": "api"
}'
A successful response returns status: "access_granted" with current usage, remaining quota, credit balance, and overage information where applicable.
Server-side Node.js and TypeScript applications can use the official usagey SDK for typed entitlement checks, idempotent metering, checkout creation, and developer events. The REST API remains available for other runtimes.