Command Palette

Search for a command to run...

Pricing and billing

A prepaid balance, four per-million rates, the arithmetic behind a charge, and the two currencies the catalogue publishes.

Prepaid, not invoiced

Routebase runs on a prepaid balance. You add credit, and each request draws it down at the metered rate. There is no subscription, no monthly commitment, no automatic renewal, and credit does not expire.

The rate you see is the rate you pay. Prices follow the upstream provider automatically, a margin is already inside every published figure, and the upstream cost is never shown — one number per rate, not two.

What the gate checks before a request is sent

Every request passes a gate before it reaches a provider: the balance must be above zero, and the number of requests already in flight for the account must be below the concurrency ceiling. A refusal here writes no usage and costs nothing — the provider was never called.

The gate does not estimate what the request itself will cost. An account with a positive balance gets a request through, so a large call on a small balance can settle below zero. That is not silently dropped: the charge is recorded, the operator sees it, and a later pass collects it when the balance allows. The practical rule is to keep the balance above the size of the largest call you intend to make.

Four rates, per million tokens

Each model lists up to four rates, all per 1,000,000 tokens, so the numbers stay readable instead of being a decimal with seven zeros in front of them.

  • input — a prompt token you send;
  • output — a completion token the model returns;
  • cache read — a prompt token the provider already had cached, usually the cheapest of the four;
  • cache write — a prompt token stored so a later request can read it, a small premium over input.

A model without prompt caching lists only input and output. Empty cache cells mean the model has no cache price, not a free one.

How a charge is computed

For one request, the charge is each token count multiplied by its rate and divided by a million. Token counts come from the gateway's own log for that request, and each request id settles exactly once, so an import that runs twice cannot bill twice.

Worked example (illustrative rates)
input   20,000 tokens x $0.50 / 1,000,000 = $0.01000
output   5,000 tokens x $1.50 / 1,000,000 = $0.00750
                                       total = $0.01750

Rounding is up to the smallest unit the ledger stores, which is why a rounded charge is never smaller than the arithmetic above. A request that a provider served with cached tokens reports cache-read tokens at the cache rate, and its cost is lower than the same request sent cold.

USD and IDR

Prices are published in USD, and that figure is the one billing is computed from. Each USD rate also carries an IDR figure, converted at the exchange rate the catalogue last synced; if that rate is more than 48 hours old, the IDR toggle is hidden rather than showing a stale conversion.

Optional spend limits

A spend limit is a ceiling on what an account may spend inside a rolling window — one day, seven days or thirty days. Rolling means the same limit means the same thing on the 1st and the 31st, and nothing resets at midnight.

The limit is checked at the same gate as the balance, on the same transaction, so a request that would cross it is refused with `402 spend_limit` and never sent. Two requests cannot slip past the same ceiling between them. There is one ceiling per period for the account.

What moves a bill

  • Prompt caching. A cache read is cheaper than a fresh input token; a cache write is a small premium now for that saving later.
  • `max_tokens`. A lower ceiling bounds the most a single call can cost, because output tokens are usually the most expensive rate.
  • Streaming. A streamed call is billed the same as an unstreamed one; send `stream_options.include_usage` so you can see the counts.
  • Retries. A request that was refused before the provider is never billed; a retry after a provider error is a second call and can be billed twice.