Docs / Models and cost
Usage, caching and budgets
Track tokens and cost, understand cache hit rate, and set a daily spending limit.
The Treasury is the IDE's cost ledger. Every model call records its tokens, cache hits, and estimated cost, so you can see what a task, a project, and a model actually cost.
Where to look
- Intelligence, Treasury shows session, daily, and lifetime tokens and spend, cache hits and savings, a savings breakdown (compression, cache, output filtering, effort routing), and your top models, tools, and providers.
- Models, footer shows Today's Spend against your daily limit, your OpenRouter balance if you use it, and total saved.
Spend is tracked per project and in a global total.
Cache hit rate
Rescriptum is built to keep prompts cache-friendly. Each conversation sends a stable session identifier, the system prompt and tool definitions stay constant, and history is appended rather than rewritten, so providers can reuse the prompt prefix instead of reprocessing it. Compaction runs only when the context genuinely fills.
In day-to-day use the cache hit rate typically lands between 90% and 95%, depending on the project and the provider. Long sessions on one model do best. The number is shown live in the Treasury so you do not have to take that on trust.
What lowers it:
- Switching models mid-conversation, since each model has its own cache.
- Provider routing that moves requests between hosts. Cache Affinity, the default for OpenRouter, avoids this.
- Long idle gaps. Provider caches expire after a few minutes to an hour, depending on the provider.
- Providers that do not report cached tokens.
Cached tokens are billed at a steep discount by most providers, so a high hit rate is the largest single cost saving on long agent sessions.
Estimating cost
Cost is estimated from the model's published prices, with cached prompt tokens priced at the provider's discount where known. It is an estimate, not an invoice. For exact charges check your provider's dashboard.
Daily budget
Open Intelligence, Treasury or the Models hub to edit the daily limit.
| Setting | Default |
|---|---|
| Daily spend limit | $50 |
| Daily token limit | 1 billion tokens |
Counters reset at midnight UTC. When the spend limit is reached, the agent stops cleanly with a budget_exceeded message. Raise the limit and send the next message to continue. Work already on disk stays.
The limit protects you from runaway loops. It applies to the IDE's own calls. It cannot see spend made by other tools using the same key.
Running out of credit
If a provider reports insufficient balance, Rescriptum can switch to a fallback model (deepseek/deepseek-v4-flash by default) so the turn finishes instead of dying midway. Configure or disable this in Settings.
Reducing cost
- Stay on one model for a task.
- Use Plan or Ask to explore cheaply before Code.
- Set verbosity to Terse or Ultra in Settings.
- Keep prompts scoped to one outcome so context stays small.
- Choose a Lowest Cost routing strategy only when cache reuse is not a priority.
Where it is stored
Per-project ledgers are in %APPDATA%\rescriptum\treasury\ with a global.json aggregate. They are plain JSON and stay on your machine.