> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crovver.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Check Usage Limit (Deprecated)

> Deprecated. Use credits/balance + credits/consume instead.

<Warning>
  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`](/api-reference/credits/balance) to read remaining credits and [`POST /api/credits/consume`](/api-reference/credits/consume) to deduct them.
</Warning>

Returns the tenant's current usage for a metric and whether they're within the limit defined by their plan.

## Request Body

<ParamField body="requestingEntityId" type="string" required>
  The external tenant ID
</ParamField>

<ParamField body="metric" type="string" required>
  The metric to check (e.g., `api_calls`, `storage_gb`)
</ParamField>

<ParamField body="productSlug" type="string">
  Scope the check to a specific product's subscription. Required for multi-product orgs.
</ParamField>

## Authentication

Requires a **secret key** (`Authorization: Bearer sk_live_...`) or **public key** (`x-public-key`).

<RequestExample>
  ```bash cURL theme={null}
  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"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Within Limit theme={null}
  {
    "success": true,
    "data": {
      "allowed": true,
      "current": 4821,
      "limit": 10000,
      "remaining": 5179,
      "percentage": 48,
      "metric": "api_calls"
    }
  }
  ```

  ```json 200 Over Limit theme={null}
  {
    "success": true,
    "data": {
      "allowed": false,
      "current": 10203,
      "limit": 10000,
      "remaining": 0,
      "percentage": 102,
      "metric": "api_calls"
    }
  }
  ```
</ResponseExample>
