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

# Credits

> What a 0xArchive REST request or WebSocket message costs in API credits, how to estimate a job before it runs, and how export credits work.

A REST request costs credits by the rows it returns, with a minimum of 1 credit, and WebSocket data is billed per delivered message. Estimate a job's cost from one small request before it runs, so it fits your plan's monthly credits on [Rate limits](/rate-limits).

Your balance is in the [dashboard](https://0xarchive.io/dashboard), and current plan prices are on the [pricing page](https://0xarchive.io/pricing).

## How REST requests are billed

Row-metered routes are billed by the number of rows a request returns. Every other route costs a flat 1 credit:

```
credits = max(1, ceil(rows / rows_per_credit))
```

`rows_per_credit` depends on the endpoint family:

| Endpoint family | Rows per credit |
| - | - |
| Trades, fills, L2 order book history, funding, open interest, liquidations, Lighter L3 order book | 1,000 |
| Candles | 10,000 |
| L4 (diffs, orders, flow, TP/SL, reconstruction) | 5,000 |
| Single-value (current L2 order book, current funding, current open interest, summary, prices, freshness, instruments, symbols, pairs, outcomes) | Not metered by rows: 1 credit per request |

A smaller response lowers the charge only on a row-metered route, and only when it crosses a billing step:

| Request | Credits |
| - | - |
| Trades, 1,000 rows returned | 1 |
| Trades, 1,001 rows returned | 2 |
| Current L2 order book, `depth=1` or `depth=20` | 1 |

Trades are metered at 1,000 rows per credit, so the 1,001st row starts a second credit. A current L2 order-book snapshot (`/orderbook/{symbol}`) is a single-value route that costs 1 credit at any `depth`. L4 routes, including the current L4 book, are row-metered at 5,000 rows per credit. A request that returns no rows still costs the 1-credit minimum.

JSON and Apache Arrow output are billed identically. The opt-in `?format=arrow` response (available for the trades family) is never cheaper or more expensive than JSON.

## How WebSocket data is billed

WebSocket data, live and replay, is billed per delivered message, at no more than 1 credit a message. An L4 batch message counts as one message, however many events it carries.

## Estimate a job

<Steps>
  <Step title="Pull a complete sample window">
    Pick the route and symbol the job will use and a sample window, for example one hour of BTC trades. Page through the whole window, following `meta.next_cursor` until `meta.has_more` is `false`. The first page shows only what one page costs.
  </Step>

  <Step title="Add up the charge for every page">
    Each page costs `max(1, ceil(rows / rows_per_credit))`, with `rows` from that page's `meta.count`. Their sum is the window's cost. You can also watch `x-credits-used` rise across the run. It counts the whole account's usage, so it matches the run's cost only when nothing else on the account runs at the same time.
  </Step>

  <Step title="Sample more than one period">
    Row counts follow market activity, so one quiet hour underestimates a busy one. For a large job, sample several windows, such as a quiet and a busy hour or the same hour on several days. Scale the highest window cost by the number of windows and symbols in the job.
  </Step>

  <Step title="Compare with your balance">
    Every metered response carries `x-credits-remaining` and `x-credits-reset` headers. Keep the estimate under what remains, with headroom for retries.
  </Step>
</Steps>

Separate the estimate by market type (Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, Lighter) and by data type rather than summing one vague market-data job, because row counts differ widely between a quiet market and a busy one.

A WebSocket job costs no more than 1 credit for each delivered message, so its ceiling is the number of messages it receives. To see what a stream actually used, the usage view in the [dashboard](https://0xarchive.io/dashboard) shows your credits with REST and WebSocket counted separately.

## Export credits

Export credits pay toward Bulk Exports, separately from API credits: each paid plan adds a monthly amount, listed on [Rate limits](/rate-limits). Monthly export credits roll over without expiry up to 2x the monthly allowance. The served credits response reports `expiry_policy` as `"never"` and `rollover_cap_cents`. Quotes, payment and order status are on [Export checkout](/export-checkout).

Credits pay for access; they do not grant data rights. Benchmark, index, financial-product, standalone or substitute market-data, raw-redistribution, white-label and OEM uses need written permission: see [Data rights](/data-rights) or [contact us](https://0xarchive.io/contact?utm_source=docs\&utm_medium=referral\&utm_campaign=docs_referral\&utm_content=credits_contact).

## Next step

See each plan's monthly credits, request rate and concurrency on [Rate limits](/rate-limits).


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