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

# Entitlements Usage

<Warning>
  The user authentication in all the flows related to the billing API is handled by the client backend app in same way in <Link href="/tutorials/authentication-and-plans">Authentication and Plans</Link>.
</Warning>

This guide explains the flow for using entitlements in your app.

## Entitlement Usage Flow

<img src="https://mintlify.s3-us-west-1.amazonaws.com/locai-6a77a221/images/Entitlement-Usage.png" alt="Entitlements Usage Flow" />

<Steps>
  <Step title="Client UI Initiates Action">
    The client UI sends a request to the client backend for an action, such as downloading a resource.
  </Step>

  <Step title="Client Backend Checks Entitlement">
    The client backend calls the Billing API endpoint `/api/v1/entitlements/status` to check if the user is allowed to perform the action.
  </Step>

  <Step title="Billing API Responds">
    If the user is not entitled, the Billing API returns an error. The client backend should handle this error appropriately.
    If the user is entitled, the Billing API returns a success response.
  </Step>

  <Step title="Client Backend Processes Action">
    If entitled, the client backend can perform the action or forward the success response to the client UI.
  </Step>

  <Step title="Report Usage">
    The action execution is reported to the Billing API using the `/api/v1/entitlements/usage` endpoint.
  </Step>
</Steps>
