Skip to main content
POST
/
usage
/
access
cURL
curl -X POST "https://api-meter.metrifox.com/usage/access" \
  -H "x-api-key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_key": "cust-6d11ca90",
    "feature_key": "feature_interview_booking",
    "quantity": 1,
    "event_id": "evt_chk_001"
  }'
{
  "data": {
    "customer_key": "cust-6d11ca90",
    "feature_key": "feature_interview_booking",
    "requested_quantity": 1,
    "can_access": true,
    "recorded": true,
    "unlimited": false,
    "balance": 3,
    "used_quantity": 7,
    "entitlement_active": true,
    "prepaid": false,
    "wallet_balance": 0,
    "message": "Feature found"
  }
}
Usage endpoints are served from https://api-meter.metrifox.com. Other API calls stay on https://api.metrifox.com.
For example, before a customer generates an AI image, check they have quota and record the generation in a single call.
If the action doesnโ€™t complete โ€” or the customer ends up using a different amount โ€” correct the recorded usage with Adjust a Usage Event.

Authorizations

x-api-key
string
header
required

Body

application/json
customer_key
string
required

The unique customer identifier in your application.

event_id
string
required

Required idempotency key. The usage is recorded at most once per event_id, so retries are safe.

feature_key
string | null

Feature to check and record against. Either feature_key or event_name is required.

event_name
string | null

Event name configured on the feature. Either event_name or feature_key is required.

quantity
number
default:1

Quantity to check and record. Defaults to 1.

credit_used
number | null

Optional credits used for this event (prepaid features).

Response

Access checked. When can_access is true the usage was recorded.

data
object