# Cost per conversation

> What a whole conversation costs with StateJar and without it, with the reply and StateJar's own extraction calls both counted, on a 17-turn, a 40-turn and a 100-turn chat. StateJar cuts the reply bill by up to 85.1%, and on the cheapest reply model the extraction costs more than that saves.

## The short answer

- **Two bills, counted together.** Without StateJar you pay your reply model to re-read the whole chat every turn. With StateJar the reply model reads a small memory block and the last 3 messages, and **StateJar reads each message you send into facts, which is a model call too.** This page adds both.
- **The reply bill falls a lot on a long chat.** On the 100-turn chat the reply model's bill is $0.1153 without StateJar and $0.0172 with it, 85.1% less. On the 17-turn chat it is 42.3% less.
- **The total does not always fall.** With the extraction calls added, the 100-turn chat costs $0.1349 with StateJar against $0.1153 without it on `gemini-3.5-flash-lite`, 17.0% more. On the 17-turn chat it is $0.0246 against $0.0042. StateJar costs more in every one of these chats when the reply model is that cheap.
- **It pays when the reply model costs more.** On the same 100-turn chat with `gemini-3.6-flash` as the reply model, the bill is $0.2754 without StateJar and $0.1477 with it, 46.4% less. Break-even on that chat is a reply model that charges $0.3598 per million input tokens or more.
- **Where the extraction money goes.** Most of it is the instructions sent with every message: 3,362 tokens for the main read, 1,304 for the everyday-facts read, 233 for the verifier, whatever the message says.

Measured offline on synthetic conversations; the method and every caveat are below. No model was called.

## Cost per conversation

Reply model `gemini-3.5-flash-lite` ($0.30 per million input tokens, $2.50 per million output), extraction on the same model, last 3 messages sent, every message extracted.

| Chat | Turns | Without StateJar | With: reply | With: extraction | With: total | Total saved | Reply bill saved |
|---|---:|---:|---:|---:|---:|---:|---:|
| 17-turn demo | 17 | $0.0042 | $0.0024 | $0.0222 | $0.0246 | -485.8% | 42.3% |
| 40-turn mixed | 40 | $0.0195 | $0.0067 | $0.0495 | $0.0563 | -188.4% | 65.5% |
| 100-turn chat | 100 | $0.1153 | $0.0172 | $0.1178 | $0.1349 | -17.0% | 85.1% |

A negative figure means StateJar cost more. If the greeting and plain-question messages are never sent to a model (a gate that skips them), the 100-turn total is $0.1212, 5.1% more than without; the 40-turn total is $0.0473, 142.4% more. The offline run has no span detector, so this is the least the extraction can cost, not a promise.

## Other reply models

The 100-turn chat, extraction unchanged.

| Reply model | Without StateJar | With StateJar | Total saved |
|---|---:|---:|---:|
| `gemini-3.5-flash-lite` ($0.30 in) | $0.1153 | $0.1349 | -17.0% |
| `gemini-3.6-flash` ($0.75 in) | $0.2754 | $0.1477 | 46.4% |
| `gpt-4o-mini` via OpenRouter ($0.15 in) | $0.0543 | $0.1230 | -126.4% |

The dearer the reply model, the more the input StateJar removes is worth, while the extraction bill stays the same.

## Tokens behind the money

| Chat | Reply input without | Reply input with | Extraction calls | Extraction input tokens |
|---|---:|---:|---:|---:|
| 17-turn demo | 7,994 | 2,075 | 34 | 62,961 |
| 40-turn mixed | 49,088 | 6,476 | 71 | 148,400 |
| 100-turn chat | 341,309 | 13,998 | 152 | 365,275 |

Counted with tiktoken `cl100k_base`. The 100-turn chat is a new synthetic one: a person planning a cafe, with facts, revisions, recall questions, small talk and requests to write something.

## Several sessions

Split the same 100 turns into three sessions and the numbers do not change: a new session starts with only the handle, and the same memory block is rebuilt from it. An app that kept the whole earlier transcript for each new session pays the "without" figure above. An app that drops the transcript at a new session would pay $0.0470 for the reply model on this chat, and then could not answer a question about anything said in an earlier session.

## What this does not show

- **Extraction is counted from the app's own prompts**, one main read per message, a second read when the message mentions people, money or events, and a verifier call per stated fact. The output is the size of the JSON for the facts the message states. Gemini models think before they answer and bill the thinking as output; that is not in these figures, and it would raise the extraction bill.
- **Provider prompt caching, which discounts a repeated prefix, is not applied.** The fixed instructions repeat on every call, so caching them is the largest saving this page does not take.
- The memory is built from each fact turn written as a plain statement, the form the pipeline reads best; in the 100-turn chat 33 of 39 such turns changed the stored memory.
- The "without" side sends no system prompt of its own; a real app would send one on both sides.
- Prices are the paid-tier list prices StateJar keeps for its own cost estimates, read on 2026-10-21. The free tier bills nothing and a provider's prices change.
- Replies are synthetic text of realistic length and are the same on both sides; this measures cost, not answer quality.

## How it was measured

`backend/benchmarks/bill_demo.py` runs each conversation through the real pipeline (extract, update, hash, retrieve, build the memory block), counts the tokens a reply model would read with and without it, adds the extraction calls, and prices them. The results are `backend/benchmarks/bill_results.json` and `bill_results.md`, produced by one command: `python benchmarks/bill_demo.py`. A test holds every figure on this page to that file.

Your own account's numbers are on the dashboard (tokens sent, saved against sending the whole memory, and the extraction cost) and, for the chat in front of you, in the Playground's Tokens tab. See also [save tokens](/docs/save-tokens.html) for the pattern, and [pricing and payments](/docs/pricing-and-payments.html) for who pays for extraction.

## Questions

**Who pays for the extraction calls?** On the hosted service the cloud read is at StateJar's cost within your plan's monthly budget of cloud-read messages, and is not billed to you; with your own provider key it is on your bill. The tables above count it either way, so the totals do not depend on who pays.

**Is the saving real if the total is negative?** The reply bill really is smaller; the total is larger because reading each message into facts is also a model call. If your reply model is dear, or your chats are long, the total falls too. The break-even table in `bill_results.md` gives the reply price at which each chat breaks even.

**Where are my own figures?** Dashboard, "What StateJar saves you", and the Playground's Tokens tab. A figure that cannot be known is a dash, not zero.
