The token cost of an AI incident investigation is not a per-incident price. It is the number of agent steps multiplied by everything the agent re-sends on each step: tool definitions, system prompt and the whole transcript so far. In the worked arithmetic below, a 30-step investigation sends 1.17 million input tokens, which is $4.86 at Claude Opus 5.5 list price with no caching and $0.74 when the full prefix is read from the prompt cache. Aurora SRE marks cache breakpoints per provider, records cache reads and writes for every model call, and prices them separately. Those dollar figures are arithmetic from list prices, not a measurement. We do not have a measured cost per investigation to publish, and we say below exactly what we did measure.
This post exists because of a bug. Aurora had a cache breakpoint on its system prompt, written in Anthropic's cache_control format. On native Amazon Bedrock that flag never reached the wire: the Converse client kept the text and discarded the marker. Bedrock deployments paid full input price for every prompt token on every step, and because nothing recorded cache usage, nobody could see it. PR 722 fixed the marker and added the accounting. A test pins the old behaviour:
def test_cache_control_is_dropped_by_converse(self, converse):
# Why native Bedrock needs cachePoint: Converse discards the Anthropic flag
sys_msg = build_cached_system_prompt("anthropic/claude-x", BIG, provider=_anthropic())
_, system = converse._messages_to_bedrock([sys_msg, HumanMessage("hi")])
assert system == [{"text": BIG}]
For vendor prices per seat, per credit and per investigation, see our AI SRE and incident tool pricing comparison. This page is the engineering side: where the tokens go.
How much does an AI SRE investigation cost in LLM tokens?
A model API is stateless. An agent that runs kubectl get pods, reads the result and decides what to run next makes a new request for each decision, and each request carries everything before it. If the tools and system prompt are P tokens and each step adds d tokens of tool call and tool result, step k sends P + (k-1)d input tokens. Over N steps:
input tokens = N*P + d*N*(N-1)/2
cost = (uncached * in + written * in * w + read * in * r + output * out) / 1,000,000
in and out are the list prices per million tokens, w is the cache write multiplier and r the cache read multiplier. The second term grows with the square of the step count.
Worked example. Assumptions, ours and not measured: P = 10,000 tokens, d = 2,000 tokens per step, 300 output tokens per step, N = 30, every step inside the cache lifetime. Prices are Anthropic's list prices on 2026-12-02: Claude Opus 5.5 at $4 input, $5 five-minute cache write, $0.20 cache read and $20 output per million tokens; Claude Haiku 5.5 at $0.10, $0.125, $0.01 and $0.50 for prompts up to 100K tokens.
| Scenario (30 steps, 1,170,000 input tokens, 9,000 output) | Uncached | Written | Read | Opus 5.5 | Haiku 5.5 |
|---|---|---|---|---|---|
| No caching | 1,170,000 | 0 | 0 | $4.86 | $0.12 |
| Tools and system prompt cached | 870,000 | 10,000 | 290,000 | $3.77 | $0.10 |
| Whole prefix cached, breakpoint on the last message | 0 | 68,000 | 1,102,000 | $0.74 | $0.02 |
Caching only the system prompt saves 22% here, because by step 30 the transcript is 58,000 tokens and the system prompt is 10,000. And the model choice moves the bill more than caching does: uncached Haiku 5.5 is cheaper than fully cached Opus 5.5. Plug in your own P, d and N. The bottom row is what Aurora sends on native Bedrock, but Bedrock sets its own prices and we did not check them for this post, so the dollar columns are Anthropic API list prices only.
How does prompt caching differ on Anthropic, OpenAI, Gemini and Bedrock?
All four cache a repeated prompt prefix. They differ in who places the boundary, what a write costs and how usage is reported. Checked against each provider's documentation on 2026-12-02:
| Provider | Who places the boundary | Minimum prefix | Write price | Read price | What Aurora sends |
|---|---|---|---|---|---|
| Anthropic API | You, with cache_control on a content block, up to 4 breakpoints (a top-level automatic mode also exists) | 512 to 4,096 tokens by model | 1.25x input for 5 minutes, 2x for 1 hour | 0.1x input on most models, 0.05x on Opus 5.5 and Sonnet 5.5, 0.025x on Fable 5.1 and 5.2 | Two breakpoints, both in the system prompt |
| Amazon Bedrock (Claude, Converse API) | You, with a standalone cachePoint block, up to 4 | 512 to 4,096 tokens by model | The model's cache-write rate | The model's cache-read rate | Three cachePoint blocks: tools, system, last message |
| OpenAI | Automatic. GPT-5.6 and later also accept explicit prompt_cache_breakpoint markers | 1,024 tokens on GPT-5.6 and later | GPT-5.6 and later: 1.25x input for the 30-minute default. Earlier models: no write charge | 0.1x input on most GPT-5.6 and later models | Nothing |
| Gemini API | Automatic (implicit caching, on by default for Gemini 2.5 and newer) | 4,096 tokens on Gemini 4, 3.8 Flash and 3.6 Flash | No write surcharge | 95% off on Gemini 4, 90% off on 3.8 and 3.6 Flash | Nothing |
Google's page says implicit caching "is opportunistic and offers no guaranteed retention window or cost savings". AWS says the same about its own: support for prompt caching "doesn't guarantee a cache hit for any request".
In Aurora each provider class declares its dialect through one method, prompt_cache_style(model), and the default is no marker at all. From base_provider.py: "OpenAI and Gemini cache a repeated prefix on their own and can reject an explicit marker, so they stay on this default."
Where do the cache breakpoints go?
A cache hit needs a byte-identical prefix, so the first job was making one. The system prompt is split in two by assemble_system_prompt_parts in composer.py. The static part (the invariant instructions, provider constraints, regional rules) contains no clock, no incident data and no organization data, so it is identical across sessions. Everything per user or per incident (policy, memories, integration index) goes after it. Then cache_control.py renders the boundary in the provider's dialect:
if style == CACHE_STYLE_CACHE_CONTROL:
blocks = [{"type": "text", "text": static_text, "cache_control": dict(_EPHEMERAL)}]
if dynamic_text:
blocks.append({"type": "text", "text": dynamic_text, "cache_control": dict(_EPHEMERAL)})
return blocks
# Bedrock Converse drops cache_control; it only honors a standalone cachePoint
# block. The suffix is covered by the last-message point (BedrockPromptCacheMiddleware).
if style == CACHE_STYLE_BEDROCK:
blocks = [{"type": "text", "text": static_text}, dict(BEDROCK_CACHE_POINT)]
if dynamic_text:
blocks.append({"type": "text", "text": dynamic_text})
return blocks
On native Bedrock a middleware adds two more points on every turn: one after the tool definitions and one at the end of the last message, so the growing transcript is read from cache on the next step. That is three per request, under the limit of four, and a test runs an agent against a mocked Converse client and asserts the count is exactly 3.
A breakpoint on a prefix shorter than the model's cacheable minimum is accepted and caches nothing. The first version used one flat character threshold for every model, which cannot be right for all of them: the minimum is 512 tokens on Opus 5.5 and 4,096 on Haiku 4.5. The table is now per model family, estimated at 4 characters per token, and unknown families get 4,096. When only the whole system prompt reaches the minimum, one breakpoint goes at its end.
How are cache tokens tracked and priced?
Providers do not agree on what "input tokens" means. Anthropic's input_tokens and Bedrock's inputTokens count only the tokens that were neither read from nor written to the cache. OpenAI's count includes them. Subtract cached tokens from a count that already excludes them and the cost comes out too low. usage_normalizer.py puts every provider on one convention, where input always includes cache reads and writes:
cache_total = cache_read + cache_write
total_tokens = _as_int(usage.get("total_tokens"))
# ...
if cache_total and total_tokens == input_tokens + output_tokens + cache_total:
input_tokens += cache_total
That heuristic is the one place we have a live measurement. During review, a reviewer made two calls to Claude Haiku 4.5 on Bedrock in us-east-1 with a system cache point. The first returned inputTokens 13, cache write 6,854, totalTokens 6,871. The second read 6,854 tokens from cache. Those counts are locked into test_live_bedrock_haiku_write_counts. It is a two-call check of the token accounting, not a hit rate over a real investigation.
Each model call becomes one row in llm_usage_tracking with session, model, request type, input, output, cache_read_tokens, cache_write_tokens and an estimated cost. The cost function in llm_usage_tracker.py splits input three ways:
non_cached_input = max(
input_tokens - cached_input_tokens - cache_write_tokens, 0
)
input_cost = (non_cached_input / 1000) * pricing["input"]
if cached_input_tokens > 0 and "cached_input" in pricing:
input_cost += (cached_input_tokens / 1000) * pricing["cached_input"]
# ...
if cache_write_tokens > 0:
write_rate = pricing.get("cache_write")
if write_rate is None:
write_rate = pricing["input"] * cls._cache_write_multiplier(model_name)
input_cost += (cache_write_tokens / 1000) * write_rate
The incident view sums those rows over the investigation's sessions, and /api/llm-usage/session/<session_id> returns the per-call breakdown. The UI labels the number "Estimated cost". To see whether caching is working on your deployment, the query from the PR:
SELECT model_name, SUM(cache_read_tokens) AS read, SUM(cache_write_tokens) AS written, SUM(input_tokens) AS input
FROM llm_usage_tracking WHERE timestamp > now() - interval '1 hour' GROUP BY 1;
Which model calls were being paid for twice?
Caching makes repeated tokens cheaper. PR 828 removed calls that should not have happened.
The safety judge ran twice per cloud command. Aurora's command gate asks a model whether a command is safe before it runs. The gate judged the command as the agent wrote it. The cloud tool then appended its own flags (--project, --format=json, --region), the executor hashed the new string, found no approval for that hash and judged it again. carry_guardrails_approval now moves the approval onto the exact argv that runs.
A large tool output was summarized twice. Tool outputs over 40,000 characters are summarized by a model before the agent reads them. Two code paths, one for stored history and one for the agent's context, each summarized the same text. Both now share one helper that remembers the summary per session, model and output hash.
The PR description counted rows in llm_usage_tracking on a local stack, asking the same three-command question each run:
| Build | Safety judge calls | Summarization calls (one 416K-character output) |
|---|---|---|
| main | 6 | 2 |
| PR branch | 3 | 1 |
| main, one rule marked "Always allowed" | 3 | 2 |
| PR branch, one rule marked "Always allowed" | 0 | not reported |
The first version of both fixes was wrong, and review caught it. The summary cache keyed on the text, but one caller saw the output before secret redaction and the other after, so on the cloud tools the hashes differed and both summaries were still made. Worse, the first call sent unredacted output to the summarizer. The helper now redacts before it hashes or summarizes. And carrying the approval skipped the only signature check that ran on the de-quoted command: a reviewer showed a command with a quote-split ba''sh that passed the matcher as written and matched once re-joined. The carry now refuses any command whose executed form trips the signature matcher, and refuses to move an approval onto a different program. Saving a model call is not worth dropping a deterministic check, the same position we took when a deny rule blocked a read-only command.
PR 757 is the same idea for memory. The call that picks which saved memories to inject used the RCA model, which is Opus when cost routing is off. It now uses the small model the active provider can serve (Haiku 5.5, Gemini 3.5 Flash-Lite or GPT-5.6 Luna), overridable with MEMORY_SELECTOR_MODEL, and ranks the bank down to 100 candidates before the call.
What is still unsolved?
- No measured hit rate or cost per investigation. The PR description says no live Bedrock call was run, so "real cache hit rates are unconfirmed". The two-call check made later in review is all we have.
- On the Anthropic API and OpenRouter, only the system prompt is cached. There is no last-message breakpoint on that path in v1.5.31, so the transcript is billed at full input price: the middle row of the table, not the bottom one.
- Bedrock cross-region inference can turn reads into writes. AWS documents that routing across Regions "may lead to increased cache writes".
- The rejection guard matches error text. If Bedrock rejects a cache marker, Aurora retries once without markers and remembers the model and region for the life of the process. The first version remembered it on the client object, which is rebuilt every turn, so a rejecting model would have paid for a failed call on every step. The match strings were never confirmed against a real rejection.
- The cost is an estimate from a static price table. On 2026-12-02 the static fallback row for Gemini 4 Argon still holds the introductory $2 and $10 rates that the code comment says ended on 2026-11-30. The write premium is applied only to Claude models, so the 1.25x that OpenAI now charges on GPT-5.6 writes is not priced. Cache token counts are stored, but no API route returns them and the UI does not show them.
- The judge and the summarizer default to the main model. Unless
SUMMARIZATION_MODELis set, the summarizer runs onMAIN_MODEL, which defaults to Opus 5.5. So does the judge unlessGUARDRAILS_LLM_MODELis set, except in OpenRouter mode, where it defaults to Gemini 2.5 Flash-Lite. - No budget cap. Aurora reports spend. It does not stop an investigation at a dollar limit.
Try it
Caching needs no setting: on Anthropic, OpenRouter with Claude models and native Bedrock it is on in v1.5.31. For a self-hosted install, the settings that move the bill are:
RCA_OPTIMIZE_COSTS=true # background RCA on Haiku 5.5 when RCA_MODEL is unset
GUARDRAILS_LLM_MODEL=<small model> # safety judge; defaults to MAIN_MODEL outside OpenRouter mode
SUMMARIZATION_MODEL=<small model> # tool-output summaries; defaults to MAIN_MODEL
Check the first one. The code default for RCA_OPTIMIZE_COSTS is true, but .env.example and the Helm values.yaml both ship it as false, which puts background RCA on Opus 5.5 unless RCA_MODEL is set. Then run the SQL above after a few investigations and look for read greater than zero.
Source: github.com/Arvo-AI/aurora. Product: aurora-ai.net. Walkthrough: cal.com/arvo-ai/demo.
Verified against Aurora v1.5.31 and each provider's documentation on 2026-12-02.