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

# How Unprice Works

> A high-level architecture view of where Unprice fits in your product.

Unprice sits between your product, your payment provider, and the paid work your customer triggers.

Your app still owns the product experience and workload execution. Your payment provider still
captures payment. Unprice owns the customer money path between them: pricing rules, entitlement
decisions, usage evidence, wallet credits, billing state, and the trail that explains why work was
allowed, denied, or billed.

<Frame caption="The request-to-invoice money path">
  <img src="https://mintcdn.com/unprice/vXUWXLNyOcaxnjxH/images/money-path.svg?fit=max&auto=format&n=vXUWXLNyOcaxnjxH&q=85&s=5a481dfd30e0d6c052eeab4cfc375bb1" alt="A paid action flows through plan version, entitlement, budget, and wallet checks, then is allowed or denied before work runs while invoice evidence is preserved." width="1200" height="520" data-path="images/money-path.svg" />
</Frame>

## The Three Boundaries

<CardGroup cols={3}>
  <Card title="Your product" icon="code">
    Owns the user experience, workload execution, and the moment a paid action is about to run.
  </Card>

  <Card title="Unprice" icon="route">
    Owns pricing rules, entitlement decisions, budgets, wallet credits, billing state, and evidence.
  </Card>

  <Card title="Payment provider" icon="credit-card">
    Captures or simulates payment through Stripe, Sandbox, or a custom provider adapter.
  </Card>
</CardGroup>

## The Money Path

| Stage            | What happens                                                                         | Why it matters                                                              |
| ---------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
| Paid action      | Your app is about to run work that can create cost                                   | The money question happens before the cost exists                           |
| Pricing model    | Unprice resolves the plan version, feature, meter, and entitlement                   | Pricing logic stays out of product branches                                 |
| Runtime decision | Unprice checks entitlement, budget, wallet credits, and meter rules                  | The request can be allowed or denied immediately                            |
| Evidence trail   | Usage facts, wallet movement, ledger entries, and invoice evidence are kept together | Support, analytics, replay, and invoices share one explanation              |
| Payment capture  | The provider adapter captures or simulates money movement                            | The payment rail can change without moving pricing logic back into your app |

## The Payment-provider Boundary

Unprice is not a Stripe wrapper. Stripe is the built-in production adapter today, and Sandbox is
available for testing. The important boundary is the provider interface: invoice creation, invoice
items, payment methods, checkout/setup sessions, payment collection, and webhooks are provider
operations.

That means the pricing and evidence path can stay in Unprice while the payment-capture system can
change. A team running its own deployment can implement another provider adapter without moving
entitlement, metering, wallet, billing, or invoice-evidence logic back into product code.

## The Runtime Paths

<CardGroup cols={2}>
  <Card title="Ask without changing state" icon="shield-check" href="/libraries/ts/sdk/access/check">
    Use `access.check` when your app only needs to know whether a customer can use a feature.
  </Card>

  <Card title="Decide and apply now" icon="gauge" href="/libraries/ts/sdk/usage/consume">
    Use `usage.consume` when known usage should be blocked if the customer is over limit, budget, or credits.
  </Card>

  <Card title="Report usage evidence" icon="file-invoice-dollar" href="/libraries/ts/sdk/usage/record">
    Use `usage.record` when the request should not wait for Unprice to decide.
  </Card>

  <Card title="Reserve a workload budget" icon="route" href="/libraries/ts/sdk/runs/start">
    Use `runs.start`, `runs.consume`, and `runs.end` for jobs, workflows, tool chains, and agents.
  </Card>
</CardGroup>

## What Unprice Does Not Own

Unprice does not run your product workload. Your application still decides when to call the LLM,
start the job, send the API request, or execute the workflow.

Unprice also does not replace your payment provider. Stripe, Sandbox, or another provider adapter
still captures or simulates money movement. Unprice owns the pricing logic and evidence path that
explains what should be charged, credited, denied, or replayed.
