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

# Check Feature Access

## Overview

When you create an offering in Metrifox, you define which features customers can access based on their plan or add-ons.

Use the `CheckAccess` method to verify whether a customer is entitled to a specific feature. This lets you:

* Grant access
* Block usage
* Prompt for upgrade
* Bill for overage

## Checking Metered Features

Before a customer uses a metered feature, you can check:

* Whether they’re allowed to use it
* How much usage they’ve already consumed

**Example: AI Image Generation**

Let’s say your free plan includes **50 AI image generations per month**.

Before generating an image, use the `CheckAccess` method to see if the customer has any remaining quota. If they do:

1. Allow the image generation
2. [**Record the usage**](https://docs.metrifox.com/api-reference/usage/record-usage) event so Metrifox can update their balance.

   <Card title="SDK available in" icon="file-code" iconType="solid" horizontal="false" href="https://docs.metrifox.com/api-reference/usage/check-access" cta="See SDK">
     Javascript | Ruby | cURL | Python | PHP | Go | Java
   </Card>

   ```json theme={null}
   {
     "message": "Access checked",
     "can_access": true,
     "customer_key": "cust-6d11ca90",
     "feature_key": "feature_interview_booking",
     "required_quantity": 1,
     "used_quantity": 6,
     "included_usage": 1,
     "next_reset_at": 1758412800000,
     "quota": 10,
     "unlimited": false,
     "carryover_quantity": 0,
     "balance": 4,
     "entitlement_active": true
   }
   ```

<Note>
  If a customer’s payment fails, by default, Metrifox will block access to the feature.
</Note>

## Check and Record in One Call

To check access and record the usage in one step, use **`POST /usage/access`**. If the customer is
allowed, the usage is recorded; if not, nothing happens.

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

See [Check Access & Record](/api-reference/usage/check-and-record) for details. If the action later
fails or the customer uses a different amount, [adjust the recorded usage](/api-reference/usage/adjust-usage).

### **Checking Boolean Feature Access**

Use the `CheckAccess` method to verify if a customer should have access to a feature.
