Skip to content

Credits & model costs

Reservations, settlement and provider dollars.

Dollars and credits answer different questions

Provider cost is the amount your model account charges. Application credits are integer budget units in your own product. A source-code purchase supplies neither a provider balance nor workspace credits.

The AI Agent Cost Calculator estimates both from editable assumptions. Its sample rates are illustrative, not verified provider prices.

Current token policy

packages/agents/src/contracts.ts defines 1,000 tokens per credit. Input plus output tokens round up per model call:

Code

estimated call credits = ceil((input tokens + output tokens) / 1000)
example: 2000 input + 600 output = 3 units
three identical calls = 9 units

Delegated calls also consume the graph budget. Do not round all calls together: rounding happens per call. A model’s dollar price does not change the current token-unit policy.

Reservation before execution

Before each provider call, the runtime reserves a conservative token budget. This can exceed the expected actual token use. Workspaces need enough available units for reservations, not just an average calculator estimate.

Budgets also constrain model calls, tool use, steps and delegated work. A projected token price is not permission to exceed an agent definition’s limits.

Settlement after execution

Observed usage permits settlement against the reservation. The runtime records an immutable reversal and actual debit transactionally, bounded by the reserved charge. Known unbilled outcomes can settle to zero. Missing reliable usage or settlement failure can retain the reservation; do not claim every failed call is free.

Usage measurements remain separate from credit ledger operations. Idempotency keys, fingerprints, workspace locks and credit lots prevent repeated grants or concurrent spend from quietly creating balance.

Your product policy

You can adapt product plans and allowances above the ledger contracts. Keep integer arithmetic, current authority, reservations and idempotent settlement intact. Do not turn a browser return or an AI answer into a credit grant.

Free workspaces begin with zero credits. Use the operator-only development grant from the quickstart, or configure your own supported Stripe workspace subscriptions. Live checkout remains gated; the source offer is separate.

Budget for hosting, PostgreSQL, email, integrations, research, taxes and provider fees independently. See limits and costs.

Explore in context