> For the complete documentation index, see [llms.txt](https://tron-energy-doc.crypto-chief.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tron-energy-doc.crypto-chief.com/getting-started/billing.md).

# Billing

## Billing

Energy is charged to your **platform API credits** — the same balance every other Crypto Chief call spends. There is no separate energy wallet, no top-up specific to this API, and nothing is ever taken out of your blockchain wallets to pay for it.

Check it with [`GET /v1/balance`](/api-reference/balance.md), top it up the way you already do.

### What you are charged

The price you were quoted, converted to credits at the TRX rate in force when the order settles. Both figures are on every order:

```json
{
  "price_sun": 5927968,
  "price_trx": "5.927968"
}
```

`price_sun` is authoritative and an integer. `price_trx` is the same number rendered for reading — never a JSON number, because a price that goes through somebody's float parser is a price that has been rounded.

### When you are charged

**Before the supplier is called, and only once.** The sequence matters:

1. Your order is claimed against its idempotency key.
2. Your credits are charged.
3. Energy is bought and delegated.

A customer who cannot pay is refused at step 2 with `402 INSUFFICIENT_CREDITS`, and nothing is bought. A retry with the same key does not charge again — billing recognises the key and returns the first result.

### Refunds

**A refusal is refunded automatically.** If a supplier answers and declines, nothing was delivered, nothing is owed, and the charge is reversed on the same key.

**An unresolved order is not refunded.** Where we cannot determine what happened, the energy may well have been delivered and paid for, and crediting you on a guess would turn one failure into two. Those orders are held for a person to reconcile, and settled either way once we know. See [Idempotency and Retries](/getting-started/idempotency.md).

### Free calls

Quoting and reading cost nothing:

| Endpoint               | Charged                           |
| ---------------------- | --------------------------------- |
| `POST /v1/quotes`      | No                                |
| `POST /v1/orders`      | **Yes** — the price of the energy |
| `GET /v1/orders/{key}` | No                                |
| `GET /v1/balance`      | No                                |

Quote as often as you like. In particular, never probe your balance by attempting an order — `GET /v1/balance` exists so you do not have to, and it keeps answering at a zero or negative balance.

### Postpaid projects

Projects are either **prepaid** or **postpaid**, and energy behaves like every other charge either way.

**Prepaid.** An order that your balance will not cover is refused with `402 INSUFFICIENT_CREDITS`. Nothing is bought and nothing is charged.

**Postpaid.** Your balance may go negative, down to your debt limit. Orders keep succeeding until the limit is reached, and are refused after it. [`GET /v1/balance`](/api-reference/balance.md) reports both numbers, so what you can still spend is:

```
credits_balance + debt_limit_credits
```

A `debt_limit_credits` of `0` means no debt is allowed, which is what a prepaid project sees. Clearing a debt is a matter of topping up: incoming credits pay it off first and only then add to a positive balance.

Which model your project is on, and the size of the limit, are set per project — the balance endpoint tells you rather than requiring you to remember.

{% hint style="info" %}
Energy bought by the **platform itself** — for sweeps, payouts and executed transactions on your wallets — is billed through the processing platform's own gas settlement, not through this API. You do not need to do anything for that; see [Energy Inside a Payment Platform](/guides/inside-the-platform.md).
{% endhint %}
