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

# Billing and trials

> Understand minor credits, welcome-credit restrictions, and payment errors

# Billing and trials

## Minor credits

Prism represents money as integer minor credits.

| Amount  | Minor credits |
| ------- | ------------: |
| THB 1   |         `100` |
| THB 20  |        `2000` |
| THB 100 |       `10000` |

Avoid floating-point arithmetic when storing balances or request costs.

## Welcome-credit trial

The welcome-credit policy reserves THB 20 (`2000` minor credits) for an eligible
one-time grant. Signing up alone does not guarantee a grant. Prism classifies an
account as a trial only after its ledger contains a `welcome_credit` entry.

Until that key owner has made cumulative positive mPAY or Polar top-ups of at
least THB 100, the welcome-credit trial is restricted to:

* chat completions only
* models listed by `GET /v1/trial-policy`

Embeddings, images, video creation, and video polling return
`trial_scope_denied`. A chat model outside the allowlist returns
`trial_model_denied`. Both errors include `allowed_models`.

```bash theme={null}
curl -sS "https://api.prismgateway.io/v1/trial-policy"
```

The response includes `policy_hash`, a SHA-256 hash of the canonical policy.
Clients can use it to detect a policy change before onboarding step 4.

## Payment required

Credit and budget failures use HTTP `402`:

```json theme={null}
{
  "error": {
    "type": "payment_required",
    "code": "insufficient_credits",
    "message": "Insufficient credits. Top up in the billing console.",
    "action": "top_up",
    "help_url": "https://dashboard.prismgateway.io/billing"
  }
}
```

Handle `action` rather than matching the human-readable message:

* `top_up`: send the account owner to `help_url`
* `contact_org_admin`: tell the user that an organization budget was reached

Possible codes are `insufficient_credits`, `reservation_failed`, and
`budget_cap_exceeded`.

[อ่านภาษาไทย](/th/billing-and-trials)
