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

# How billing works

> Exactly what is counted, what is free, and when you're charged.

## What is counted

Each successful response is billed **the bytes of the rows it sent**:

* On `/query`: the Arrow data of the rows (the column buffers).
* On `/query/json`: the JSON of the rows, which is larger for the same rows. See
  [Arrow vs JSON](https://docs.bloklake.com/responses/arrow-vs-json.md).

**Not counted**: HTTP headers, the Arrow schema and metadata (`next_block`, `archive_height`, …),
IPC framing, and the JSON metadata fields.

The bytes depend only on the **rows and columns you receive**: the number of rows matched and the
fields you selected. The size of the range you scanned, the number of filter values and the chain
don't change the price.

## Minimum per request

Every billed request counts **at least 10 KB** (10,000 bytes). A response with 3 rows of 100 bytes
is billed 10 KB; one with 5 MB of rows is billed 5 MB.

On pay-as-you-go, 10 KB is \$0.000005: a million requests that return almost nothing cost \$5. It
matters mostly for very frequent polling; see [Estimating costs](https://docs.bloklake.com/billing/estimating-costs.md#polling).

## What's free

| Request | Billed |
| - | - |
| Successful query (`200`) | rows sent, at least 10 KB |
| Rejected by validation (`400`, e.g. `invalid_query`, `unknown_query_id`), `404 unknown_set` | 10 KB |
| Set and prepared-query calls (`/v1/sets`, `/v1/queries`) | 10 KB |
| Server error (`5xx`) | **free** |
| Rate limited (`429`), out of balance or over the overage limit (`402`) | **free** |
| Missing, unknown, revoked or suspended key (`401`, `403`) | **free** |
| `/status`, `/v1/schema`, `/v1/account`, `/healthz` | **free** |
| Response cut short because the connection dropped | only the rows already sent, no minimum |

## When you're charged

* **Pay-as-you-go**: each response's cost is taken from your prepaid balance when the response
  finishes. A response that is already running when the balance runs out completes normally;
  the next request gets `402 balance_exhausted`.
* **Subscription**: each response's bytes count toward the current billing period. The first
  1 TB (or your plan's included data) is covered by the monthly price. Beyond it, overage is
  billed per GB on your next invoice, up to your overage limit. At the limit, requests get
  `402 overage_limit_reached`.

## Across chains and keys

Usage from every chain and every key of a project adds up to the same balance or allowance. The
dashboard shows it per chain and per key.

## Seeing your usage

* **Dashboard → Overview**: data, spend and balance (or this period's usage) for any time range,
  by chain and by key.
* **Dashboard → Billing**: the pay-as-you-go statement, or the subscription's usage meter.
* **API**: [`GET /v1/account`](https://docs.bloklake.com/api-reference/account) returns the key's plan, balance (pay-as-you-go) or this
  period's usage and quota (subscription). It's free and isn't rate limited.

Usage appears in the dashboard within about a minute.

## Making the same data cheaper

1. **Use `/query` (Arrow), not `/query/json`**: the same rows cost 2–2.5× less.
2. **Select only the fields you use.** Leave out `logsBloom` (256 bytes per row), `input`,
   `data` and `accessList` unless you need them.
3. **Filter as narrowly as you can** on the indexed fields, so fewer rows match.
4. **Don't fetch a blocks stream for timestamps**: select `blockTimestamp` on logs.
5. **Poll at the block time**, not faster, when following the head.
6. **Store what you read.** Re-reading finalized history costs the same every time; it never
   changes.

See [Estimating costs](https://docs.bloklake.com/billing/estimating-costs.md) for worked numbers.


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