Skip to main content
POST
/
api
/
public
/
check-usage-limit
curl -X POST "https://api.crovver.com/api/public/check-usage-limit" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "requestingEntityId": "workspace_123",
    "metric": "api_calls"
  }'
{
  "success": true,
  "data": {
    "allowed": true,
    "current": 4821,
    "limit": 10000,
    "remaining": 5179,
    "percentage": 48,
    "metric": "api_calls"
  }
}
This endpoint is deprecated. It checks the legacy usage_events table, which is no longer the source of truth for metered billing. Use GET /api/public/credits/balance to read remaining credits and POST /api/credits/consume to deduct them.
Returns the tenant’s current usage for a metric and whether they’re within the limit defined by their plan.

Request Body

requestingEntityId
string
required
The external tenant ID
metric
string
required
The metric to check (e.g., api_calls, storage_gb)
productSlug
string
Scope the check to a specific product’s subscription. Required for multi-product orgs.

Authentication

Requires a secret key (Authorization: Bearer sk_live_...) or public key (x-public-key).
curl -X POST "https://api.crovver.com/api/public/check-usage-limit" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "requestingEntityId": "workspace_123",
    "metric": "api_calls"
  }'
{
  "success": true,
  "data": {
    "allowed": true,
    "current": 4821,
    "limit": 10000,
    "remaining": 5179,
    "percentage": 48,
    "metric": "api_calls"
  }
}