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

# Billing and credits

> Understand request costs, add credits, and keep your workspace funded.

Your workspace pays for model usage from a prepaid balance. Requests use the [published model rates](/docs/models), with no usage markup. Buying credits adds a **5% platform fee**, plus tax where applicable.

| You buy         | Credits added | Platform fee | Total before tax |
| --------------- | ------------- | ------------ | ---------------- |
| \$10 of credits | 10,000,000    | \$0.50       | \$10.50          |

**1 credit = \$0.000001.** Requests served by [your own provider key](/docs/byok) cost zero gateway credits; that provider bills you directly.

## Topping up

In the [console](https://impossibl.com/dashboard), select the workspace and choose **add credits**. The minimum purchase is **\$5**. Credits become available after payment succeeds.

<Accordion title="Buy credits through the API">
  Create a hosted invoice, then open the returned `invoice_url` to pay:

  ```bash theme={null}
  curl --fail-with-body https://api.impossibl.com/v1/billing/invoice \
    -H "Authorization: Bearer $IMPOSSIBL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"amount_usd": 10}'
  ```

  ```json theme={null}
  {
    "invoice_url": "https://invoice.stripe.com/i/...",
    "invoice_id": "in_...",
    "credit_amount_cents": 1000,
    "platform_fee_cents": 50,
    "invoice_amount_cents": 1050
  }
  ```

  The invoice API rounds fractional dollar amounts down to a whole dollar. Creating an invoice does not add credits; paying it does. Read `GET /v1/billing` for the balance, minimum purchase, and fee rate.
</Accordion>

## Avoid running out

Open **auto top-up** in the console, save a card, and choose a balance threshold and purchase amount. The amount must be at least the threshold and meet the minimum purchase. When your balance falls below the threshold, the gateway charges the saved card for the purchase plus fee and tax.

Top-ups run asynchronously. Leave enough balance to cover traffic while payment completes. Failed charges can turn auto top-up off; check the message in the console, fix the card, and re-enable it.

<Note>
  A `402` can mean your balance cannot cover the estimated input cost, even when it is above zero. Output cost is settled after generation, and concurrent requests can overspend the balance. Prepaid credits are not a strict per-request or monthly spending cap. Bound concurrency and output length in your application.
</Note>

## Check what you spent

Open **usage** for totals or **logs** for an individual request. API callers can use:

```bash theme={null}
curl --fail-with-body https://api.impossibl.com/v1/account \
  -H "Authorization: Bearer $IMPOSSIBL_API_KEY"

curl --fail-with-body https://api.impossibl.com/v1/usage \
  -H "Authorization: Bearer $IMPOSSIBL_API_KEY"
```

`/v1/account` returns `balance.credits` and `balance.usd`. `/v1/usage` returns recent usage entries with a `cost` in both units. [Request logs](/docs/request-logs) include failed requests and explain which provider served a BYOK or paid request.

<Accordion title="How request costs are calculated">
  For ordinary text without caching or special rates:

  ```text theme={null}
  cost_credits = ceil(input_tokens × input_price_per_1M + output_tokens × output_price_per_1M)
  ```

  For example, at $0.15 input and $0.60 output per million tokens, 1,000 input and 200 output tokens cost 270 credits (\$0.000270). This is an illustration; use the live model's rates for an estimate.

  Actual billing accounts for each token class and rounds up once. `GET /v1/models` publishes cache-read and cache-write rates, one-hour cache writes, audio-input rates, and long-context tiers where they apply. A long-context tier can change the rate for the whole request.

  Other tasks have different units:

  * [Transcription](/docs/audio-transcription) bills on audio duration.
  * [Speech](/docs/text-to-speech) bills on characters or tokens, depending on the model.
  * [Images](/docs/image-generation) bill on token usage, with separate image and text output rates where published.
  * [Reranking](/docs/reranking) bills on evaluated input tokens.
  * [Evaluation](/docs/evaluation) bills on input tokens only; output tokens are free.
  * [Provider-executed search](/docs/tool-calling#provider-executed-search) can add a tool-call charge.

  Read the unit alongside the price. An audio minute, a million characters, and a million tokens are not interchangeable.
</Accordion>

<Accordion title="Signup credits and models that require payment">
  Agent registration returns the starting balance in its response. Claiming an agent-created account may add a one-time verification bonus; eligibility details are in the [agent quickstart](/docs/agent-quickstart).

  Some models require a completed credit purchase and return `403 billing_required` without one. Saving a card or having promotional credits does not satisfy that requirement. Requests whose resolved routes are all BYOK are exempt.
</Accordion>

<Accordion title="Postpaid workspaces">
  If your workspace is configured for postpaid billing, usage draws against its credit limit and is invoiced. The console shows the billing cycle instead of prepaid top-up controls. A negative balance can be normal; requests are rejected when remaining credit headroom is insufficient. Auto top-up does not run for postpaid workspaces.
</Accordion>
