Skip to content
Gateway and cost

See which calls ran, replayed or need reconciliation.

The gateway records model calls and can replay a completed stored response on a supported retry instead of buying it again.

Scope and operating details

The gateway records model calls and can replay a completed stored response on a supported retry. A replay is different from sending a new provider request. A missing or ambiguous result is not silently treated as a free replay or a settled charge.

RequestThe agent calls its gateway
GatewayProvider key stays outside the guest
ResponseRecorded within the supported scope
Illustrative workflow. The evidence and limitations below define the tested scope.

at most once on the KeepState ledger, enforced at the gateway

1 · agent calls

The VM sends a request using a virtual key scoped to this session.

2 · gateway meters

Tokens counted in, tokens counted out, before the provider is touched.

3 · provider answers

The response is written to the store as it streams back.

4 · call interrupted

A crash, a rate limit, a resume. The stored response survives it.

5 · retry served

The store answers, not the provider. Zero new tokens, billed once.

Tokens are not re-purchased

An interrupted call has already been paid for. On retry the gateway serves the stored response instead of buying it again, and the ledger row says so: retry served from store, 0 new tokens. Proven for Claude Code. For aider the gateway held the response 4 of 4 times and the client returned 3 of 4. Reported, not promised.

Bring your own key for any provider and the token meter disappears; keys never enter a guest, an image, or a snapshot. We meter durability only. Routing across providers is roadmap; today there is one provider path through the gateway.

ledger, the gate-3 retry

model.call · original_seq=431,486 tok
retry · served from store0 new tok
billedonce · 31,486 tokens excluded from spend

A replay is not a new provider request

A supported replay uses a completed response the gateway already stored. Nothing is sent upstream, so the KeepState ledger records the call once and no second provider request exists to be charged for.

What the gateway settles is the KeepState ledger, and only that. Your provider keeps its own accounting: if a request reached it and it billed you, that charge sits between you and your provider, and a replay on our side cannot reverse it. Anything a call already did outside the session, a write, a message, a deployment, is outside this boundary too. We make no promise about a provider's own billing and we offer no universal provider refund.

When completion or cost is ambiguous

Sometimes the gateway cannot tell whether a call completed upstream, or what it cost: a connection dies mid-stream, a provider answers late, a usage figure never arrives. A missing or ambiguous result is not silently treated as a free replay, and it is not silently treated as a settled charge.

the ruled rule · price book v1.3

Ambiguous gateway results are never billed until reconciled. Unreconciled after 24 hours resolves in the customer's favor and is flagged on the statement.

Until it is reconciled, an ambiguous call carries no charge on your statement. If reconciliation has not resolved it inside that window, the customer keeps the benefit of the doubt and the statement shows that it happened, so the outcome is visible rather than absorbed.

the supported path through the gateway, from the capability manifest

  • one provider path via the gateway: proven, scope bench v0.1.26
  • BYOK: access self-serve, deployment enabled in production
  • Managed inference: access not available, deployment production state unavailable
  • Replay of interrupted calls: access limited access, deployment proven, not enabled in production
  • Second provider: access limited access, deployment proven, not enabled in production
  • Cross-provider continuation (Claude Code): access self-serve, deployment enabled in production

Every row above is read from the derived capability source, not written here. A row that is proven but not enabled in production is exactly that, and a mode that is not available is not for sale. The availability matrix, dated per row.

Token bill on your trace

unavailable until metered

we will not quote a partner that does not exist

Double-billed interrupted calls

0 MEASURED

no request hash appears twice in billed spend, gateway-enforced. One provider path today.

evidence
badge
MEASURED
measurement
0 · no request hash appears twice in billed spend, gateway-enforced. One provider path today.
test scope
Laboratory or bench evidence; production behavior is not inferred from it.
date
28 July 2026; re-run 13 October 2026

Cache hit rate, your workload

unavailable (not yet measured)

we will not quote yours before we meter it

On the KeepState ledger a request is billed at most once: a supported retry of a completed call is served from the store and issues no new provider request. Gated on the one provider path we run. record

Send us one trace of your longest run.

We will show you which calls the ledger would record as run, replayed, or awaiting reconciliation. No savings figure, no quote, no promise about what a different setup would have cost you.

keepstate.ai · the durable agent session cloud