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

# Billing & Funding

> Prepaid USD balance: how charges are computed, and how to top up.

Credits pay for API usage, paid chat, and both studios. API pages show the USD value of your credits; studios show the same balance in credits at the current configured rate. Text models use token pricing; image models use their listed per-image or token rates.

## The billing model

* **Prepaid.** You buy credits; requests spend their USD value. When that balance reaches zero, requests return `402 insufficient_balance` until you add credits.
* **Usage-based.** Charges are rounded to six decimal places using reported tokens when available. If usage is unavailable, token estimates are used and marked with `tokens_estimated` in the usage history.
* **Transparent.** Completed non-streaming responses report `nomask.cost_usd`. For streams, request `stream_options.include_usage` for the final usage chunk. `GET /usage` keeps the settled history, including billed partial streams.
* **Partial responses can be billed.** Output already delivered during a stream may still be billed if it later fails or disconnects. Settled requests appear in `GET /usage`; operational analytics distinguish completed, interrupted and failed outcomes without storing the output.

## How cost is computed

```text theme={"system"}
model_cost_usd  = prompt_tokens     / 1,000,000 * usd_per_1m_input_tokens
                + completion_tokens / 1,000,000 * usd_per_1m_output_tokens
cost_usd        = model_cost_usd
```

Rates per model are on the [Models page](https://nomask.ai/models) and `GET /models`.

Some models add **long-context tiered pricing**. Their catalog entries carry `tier_threshold_tokens`, `usd_per_1m_input_tokens_over` and `usd_per_1m_output_tokens_over` (all `null` on flat-priced models). The two sides tier independently: when `prompt_tokens` exceeds the threshold, the whole input is billed at the over rate, and when `completion_tokens` exceeds it, the whole output is billed at its over rate. A request can hit one side, both, or neither.

```text theme={"system"}
input_rate  = prompt_tokens     > tier_threshold_tokens ? usd_per_1m_input_tokens_over  : usd_per_1m_input_tokens
output_rate = completion_tokens > tier_threshold_tokens ? usd_per_1m_output_tokens_over : usd_per_1m_output_tokens
cost_usd    = prompt_tokens / 1,000,000 * input_rate + completion_tokens / 1,000,000 * output_rate
```

* Reasoning tokens are output tokens.
* Images sent to text models are tokenized into `prompt_tokens`. Generated images use the image model's listed pricing. See [Image Generation](https://docs.nomask.ai/image-generation.md).
* The optional NoMask system prompt adds roughly 800 input tokens when enabled.

Rates are snapshotted per request: if pricing changes later, your history still shows what each request actually cost at the time.

Those full-input formulas apply when no cache discount is confirmed. For caching-enabled requests, confirmed cached input uses the applicable cached-input rate and the remaining input uses the ordinary rate. Cache-write tokens remain ordinary input; output pricing is unchanged. See [Prompt Caching](https://docs.nomask.ai/prompt-caching.md) for the exact formula, response metadata and saved-USD coverage.

## Buying credits

Open your [API dashboard](https://nomask.ai/api/overview) and click **Fund** next to the USD balance. Available payment methods are shown at checkout:

| Method | Currency | Notes |
| - | - | - |
| Flutterwave | NGN | Card, bank, mobile money. Your USD amount is charged in NGN at the current rate, updated daily. |
| Crypto (NowPayments) | USD | BTC, ETH, USDT and more, charged in USD. |

* The funding window shows the current minimum purchase before you pay.
* Crypto payments have a separate minimum, shown when you select the payment method.
* Your credits are available the moment the payment confirms, with an emailed receipt.
* If you return from checkout before confirmation, the payment finishes in the background within minutes.

> [!NOTE]
>
> Your credits never expire and are not refunded as cash. If you have credits from before the balance update, complete the one-time conversion to combine them with your existing USD balance. A final request may settle below zero; add credits before making another paid request.

## Tracking spend

* The [overview](https://nomask.ai/api/overview) charts daily spend by model or API key. The [Caching tab](https://nomask.ai/api/caching) tracks requests, hit rates and savings by model, with filtered CSV exports.
* `GET /usage` returns settled completions with their tokens, costs, key and latency.
* `GET /balance` returns the live balance; `GET /me` returns the calling key's month-to-date spend.
* Per-key monthly USD limits cap what any single key can spend; see [Authentication](https://docs.nomask.ai/authentication.md).

## Invoices and receipts

Every credit purchase appears under **Payment Transactions** in the app sidebar with a status and a downloadable PDF receipt. A receipt is also linked from the confirmation email, and the payment status page right after checkout shows the same record.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.