Cost lint

Paste a prompt to find what a prefix cache cannot reuse, and what that costs per request.

Mortar checks the text in this request and keeps none of it: nothing is stored, logged or put in a URL. Remove secrets and personal data before you paste.

What are you pasting?

Values that look like they change per request are recognised.

Where they differ is measured.

Paste the system prompt and tool definitions exactly as your app sends them. Up to 64 KB.

Paste 2 to 16 real requests, each the whole prompt as your app rendered it. Up to 64 KB in all.

Waste is priced at its sample cache prices.

Adds what the waste costs a month.

Price at your own rates (optional)

Only prompt tokens can be reused, so only prompt prices matter. A wasted token is processed and cached on every request instead of read back, so it costs the difference.

Empty counts a cached token as free, which makes the waste look larger.

Empty uses your input price, with no premium for writing to the cache.

What this checks

Pattern How it is found Status
A value that changes per request comes before stable text: a timestamp, UUID, request, session or user ID, a name or a generated token cache_hostile_ordering Recognised in one prompt. Measured across 2 or more real requests. Checked
The same JSON with its keys in a different order per request nondeterministic_ordering Measured across 2 or more real requests, by re-encoding JSON with sorted keys. Checked with 2 or more requests
A reusable prefix shorter than a hosted provider's cache minimum Compared with the reference minimums below. Shown as a note
Tool definitions reordered or changed between requests These need whole request bodies, which this page does not accept yet. Not checked yet
A model switched in the middle of a conversation Not checked yet
Conversation history rewritten instead of appended to Not checked yet

Hosted providers' cache minimums

The reference figures the check compares a reusable prefix with. Providers set them per model and change them, so the source is the authority.

The check cannot see images, cache expiry, or how your provider routes requests to its cache.

Run this from your code

The same check is one API call, with no key, limited to 30 checks a minute per address. Send 2 or more real requests as variants for a measured result.

curl https://api.mortar.one/v1/cost/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen2.5-7B-Instruct",
    "variants": ["first real request", "second real request"],
    "requestsPerMonth": 1000000
  }'

Analyze a prompt documents the request and response, and Write cache-friendly prompts explains how to order a prompt so a cache can reuse it.