StartupAPI Docs

Billing examples

Billing examples

Examples that reconcile uncached input, cache writes, cache reads, output, reservations, and partial streams with the production engine.

Reading time: 6 minutesFormula is stable; rates can change.Last updated: August 21, 2026

How a charge is formed

StartupAPI computes ceil(uncached + 1.25 × cache write + 0.1 × cache read). It charges that equivalent input at the model’s input rate, charges output at the output rate, rounds each monetary component up to an integer micro-cent, and adds the components.

  1. ReserveA temporary hold is placed before the upstream request. Streaming holds can grow progressively as delivered usage grows.
  2. SettleReported uncached, cache, and output usage determines the charge; unused hold is released.
  3. Classify failureA failure before billable usage releases the hold. A partial stream with delivered usage settles that usage. An ambiguous no-usage stream can enter settlement review.

Exact cache example

Example usage: 1,000 uncached input tokens, 2,000 cache-write tokens, 10,000 cache-read tokens, and 500 output tokens.

ceil(1,000 + 2,000 × 1.25 + 10,000 × 0.1) = 4,500 equivalent input tokens

Using the current Standard rate for the example Sonnet model at the time of this audit — $1.20 per million input-equivalent tokens and $6.00 per million output tokens — input is exactly $0.005400, output is exactly $0.003000, and the reconciled total is $0.008400.

Pre-usage failure and partial stream

If authentication, balance, model policy, connector availability, or the upstream request fails before billable usage is delivered, StartupAPI records no usage charge and releases the reservation.

If an SSE stream delivers usage and then the client disconnects, a timeout occurs, or a budget guard stops it, the delivered usage is billable and is settled up to the reserved amount. If a stream ends with no usage and no clear error, it can enter settlement review instead of being silently treated as charged or free.

See live Models & Pricing