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

# Choose an integration model

> Keep billing, entitlement, and runtime responsibilities in the right place

QuotaMint is designed to sit beside your billing system, not replace it.

You integrate with plain HTTPS requests — there is no SDK to install. Any backend language that can
POST JSON over TLS can use the runtime: see [calling QuotaMint from any language](/guides/rest-api-any-language)
for the same working pattern in Node.js, Python, Go, Java, PHP, Ruby, C#, and Rust.

## Recommended request flow

```text theme={null}
1. Your billing provider confirms a subscription change
2. Your team assigns the matching QuotaMint plan to the customer
3. A product action reaches your backend
4. Your backend calls /v1/consume with a stable idempotency key
5. QuotaMint returns allowed or denied
6. Your backend performs the work only after allowed=true
```

Stripe, Razorpay, Paddle, Lemon Squeezy, or a custom billing system remains the source of truth for payment status. When that status changes, a teammate or your billing automation assigns the matching QuotaMint plan in the dashboard.

## When to use each surface

| Need                                  | Where                      | Mutates state |
| ------------------------------------- | -------------------------- | ------------- |
| Show whether an action is available   | `POST /v1/check`           | No            |
| Authorize and charge a feature        | `POST /v1/consume`         | Yes           |
| Record usage without charging credits | `POST /v1/events`          | Yes           |
| Assign a plan to a customer           | Dashboard: **Customers**   | Yes           |
| Add purchased or manual credits       | Dashboard: customer detail | Yes           |

## Do not put QuotaMint in the browser

Project API keys identify a project and can spend credits. Keep them on your server.

Your frontend can call your own backend, and your backend can call QuotaMint. Return only the decision and information your UI needs.

## Billing-provider example

When a Stripe or Razorpay subscription becomes active:

1. Verify the provider webhook signature.
2. Map the provider price or plan to a QuotaMint plan key.
3. Assign the plan to the customer in the dashboard (or automate this step in your billing workflow).
4. Add any separately purchased credits from the customer's dashboard page.

If the billing event is delivered twice, assigning the same plan again is safe to repeat: an active plan assignment is idempotent. Credit changes recorded in the dashboard are additive and each is kept in the ledger, so review the balance before adding a manual top-up twice.

## Choosing a credit model

Use a credit feature when several resources share one allowance:

* `generate_image` costs 10 credits
* `generate_video` costs 50 credits
* `run_agent` costs 3 credits

Use `events` when you need a usage meter that does not affect the balance, such as tokens, seconds, or documents. You can use both for the same product action if you need a charge and an analytical event.
