Ultra Prompt

← All articles

How to Benchmark Claude Fable 5.1 and Cut Agent Costs by Up to 45%

Anthropic just shipped Claude Fable 5.1 with cache-read pricing at $0.25 per million tokens. Regular input tokens cost $10 per million. That's a 40x difference, and most teams running agents are leaving the entire gap on the table because they never restructured their prompts to use it. This guide gives you a repeatable benchmarking process and three copy-paste prompt templates that actually exploit the model's cache behavior. By the end, you'll have a CSV showing exact dollar savings per task and prompts ready to deploy.

What Fable 5.1's Pricing Actually Means for Agents

Anthropic's three-tier pricing for Claude Fable 5.1 breaks down like this:

  • $10 / M input tokens — new text the model reads fresh each turn
  • $50 / M output tokens — everything the model writes back
  • $0.25 / M cache-read tokens — text already stored in the prompt cache

A cached read costs roughly one-fortieth of a fresh input token. For agents that repeat the same system instructions, tool definitions, or static documents across many turns, that difference compounds fast. Anthropic says agentic workloads can see up to 45% total cost reduction under this pricing model, and the cache-read rate is central to how that math works.

The catch: you only hit the cheap rate if the same block of text stays in memory across turns. Most teams re-send the system prompt, tool list, and any context documents on every single call. They're paying $10/M for text the model already saw two seconds ago.

Long-running agents are especially exposed because they naturally generate repeated identical blocks. Every tool definition re-sent each turn, every code snippet reloaded for each review step, every PDF excerpt re-pasted for each summarization pass. Each of those repeats is an opportunity to hit the $0.25 cache rate instead of the $10 input rate.

Before vs. After: two common repeat patterns

SituationOriginal approach (Claude 5)Revised approach (Fable 5.1)
Tool definition reused 10x in a session
You are an AI assistant with access
to the "search" tool. Use it when needed.
(re-sent every turn)
System prompt, sent once:
You are an AI assistant with permanent
access to the "search" tool. Keep this
instruction cached for the entire session.
Re-reading a 2,000-token codebase each step
Here is the code: …
(included every turn)
Cache block, stored once:
[CACHE_START]
<code>…</code>
[CACHE_END]
Then each turn: Recall cached code.

One persistent system prompt can replace ten repeats. That's the entire premise — and the reason benchmarking matters. Without measuring it, you're guessing at whether it's actually working.

If you're also evaluating whether Fable 5.1 fits your broader AI stack, this 15-minute model evaluation framework gives you a structured process for any new release.

Step-by-Step Cost-per-Task Benchmarking Framework

Define cost-per-task as a single formula:

cost = (input_tokens × $10 + output_tokens × $50 + cache_read_input_tokens × $0.25) ÷ tasks_completed

Anthropic's API returns a usage object on every response with the token counts you need: input_tokens, output_tokens, and cache_read_input_tokens. The script below captures all three, calculates the USD cost per call, and writes everything to a CSV you can compare across model versions.

import anthropic, csv

client = anthropic.Anthropic(api_key="YOUR_KEY")

def run_task(prompt, system=None):
    resp = client.completions.create(
        model="claude-fable-5-1",
        max_tokens=1024,
        temperature=0,
        prompt=prompt,
        system=system
    )
    return {
        "input": resp.usage.input_tokens,
        "output": resp.usage.output_tokens,
        "cache": resp.usage.cache_read_input_tokens,
        "cost_usd": (
            resp.usage.input_tokens * 10 / 1_000_000 +
            resp.usage.output_tokens * 50 / 1_000_000 +
            resp.usage.cache_read_input_tokens * 0.25 / 1_000_000
        )
    }

# Run the same task 20 times to get stable averages
results = [run_task(task_prompt, system_prompt) for _ in range(20)]

with open("benchmark.csv", "w", newline="") as f:
    writer = csv.DictWriter(f, fieldnames=results[0].keys())
    writer.writeheader()
    writer.writerows(results)

Run it twice. First with Claude 5 (or whichever model you're currently using), then with Fable 5.1 after restructuring your prompts. The resulting CSVs give you a side-by-side cost column. That column is your ROI number.

A few things to watch in the output:

  • If cache is zero on both runs, your prompt isn't triggering cache hits. Check whether the same block of text is actually being reused across turns.
  • If input tokens drop but cache tokens don't rise proportionally, you may be shortening prompts rather than caching them. Both help, but they're different mechanisms.
  • Output tokens are usually the most expensive line item. If they're high, focus a separate pass on tightening the instruction to produce shorter, more structured responses.

Thirty tasks is a more reliable sample than twenty for real workloads, especially if your tasks vary in length. Use 20 for quick iteration, 30 when you want numbers you'd stake a budget decision on.

Prompt Templates Optimized for Fable 5.1 (Before and After)

Three patterns cover the majority of agentic workloads. Each shows the structural change that moves tokens from the expensive input bucket to the cheap cache bucket.

1. Tool Orchestration

The most common agent pattern: a system prompt listing available tools, sent on every turn.

Before (Claude 5)

System: You have access to the "search" and "calc" tools.
User: Find the latest market cap of Tesla.
Assistant: <calls search>
...
System: You have access to the "search" and "calc" tools.
User: What was the price yesterday?

After (Fable 5.1)

System (once): You have permanent access to the "search"
and "calc" tools. Keep this instruction cached
for the session.

User: Find the latest market cap of Tesla.
Assistant: <calls search>
...
User: What was the price yesterday?
Assistant: RecallTools → use "search".

Removing the repeated system prompt means you stop paying $10/M input rates for that block on every subsequent turn. Cache reads rise as the tool list is stored once and referenced from there. Net result: cheaper per turn, same behavior. Your benchmarking CSV will show the exact drop in your workflow.

2. Code Review Loop

A full code block re-sent on every review iteration is one of the costliest patterns in agentic work. Store it once.

Before

User: Review the following code for bugs:
[full codebase pasted here]
Assistant: ...

User: Now check for security issues.
[full codebase pasted again]

After

[CACHE_START]
<codebase>
[CACHE_END]

User: Review cached code for bugs.
Assistant: ...

User: Now check cached code for security issues.
Assistant: ...

The after version caches the full code block once at the start of the session. Each review step calls RecallCode. instead of re-pasting the codebase. The tiny cache-read charge at $0.25/M replaces what was costing you $10/M per turn on that block. Because cache reads are one-fortieth the price of fresh input tokens, a multi-step review loop that was previously re-sending thousands of tokens on every pass sees a meaningful cost drop. The output token count stays the same because the model is doing the same reasoning work.

You stay in control of the output quality. Caching doesn't shortcut the model's thinking. You're just not paying input rates to show the model text it already has.

3. Research Synthesis

Multi-step summarization and analysis tasks often re-send the same source document on every turn.

Before

User: Summarize the following excerpt (5 pages):
[full 5-page excerpt pasted here]
Assistant: ...

User: Now expand on point 3.
[full 5-page excerpt pasted again]

After

[CACHE_START]
<five-page excerpt>
[CACHE_END]

User: Summarize cached section 1.
Assistant: ...

User: Expand on point 3 from the cached excerpt.
Assistant: ...

Each step reads the excerpt from cache instead of re-sending the full text as fresh input. The model still reads every word of the source material. It just reads them from a cheaper memory tier. Run the benchmarking script before and after this change and the cache column in your CSV will tell you exactly how much you saved per task.

These same patterns apply if you're tracking and exporting your benchmarking results. A structured approach to building data stories in Google Sheets can help you visualize cost-per-task trends across runs without needing a dedicated analytics tool.

Plug These Prompts Into Ultra Prompt and Track Savings Without Touching Code

The benchmarking script above works, but running it manually every time you iterate isn't sustainable. Here's a faster loop:

  1. Import the Agentic Cost Optimization collection from Ultra Prompt's Prompt Template Library (filter tag fable-5.1). The templates already have the [CACHE_START]...[CACHE_END] structure baked in.
  2. Replace your current system prompts with the cached-system versions. Copy any static context blocks (code, docs, tool lists) into the cache block slots.
  3. Run the benchmarking script on a sample of 30 real tasks from your workflow. Compare the CSV to your pre-switch cost data. Adjust cache block size until you're at or below your target cost per task.

Ultra Prompt logs token usage for every template automatically, surfaces cache-read percentage in the UI, and lets you version-control prompt revisions. You can run the cost-per-task comparison without writing a line of code after setup.

If you're thinking about model costs across your broader stack rather than just one workflow, building an AI stack without single-vendor lock-in is worth thinking through before you optimize too deeply for any one model's pricing structure.

FAQ

How do I measure real cost savings when switching to Claude Fable 5.1 for agents?

Run a side-by-side benchmark using the Python script above. Capture input_tokens, output_tokens, and cache_read_input_tokens from the API's usage object, then apply Anthropic's pricing: input $10/M, output $50/M, cache $0.25/M. The difference in total USD per task across the two runs is your real savings figure.

What prompt changes work best with Claude Fable 5.1's cheaper cache reads?

Three changes move the needle most: consolidate all system instructions into a single cached block sent once per session, store large static texts (code, PDFs, document excerpts) in cache blocks and reference them by name, and stop re-sending identical tool definitions on every turn. Each change shifts tokens from the $10/M input bucket to the $0.25/M cache bucket.

Does Claude Fable 5.1 need different system prompts than Claude 5 for long-running tasks?

Yes. A Claude 5 system prompt is typically written to be re-sent each turn, which made sense when there was no cache-read discount. For Fable 5.1, rewrite the system prompt as a persistent instruction and include a directive like "Keep this instruction cached for the session." That signals to the model that the instruction block should persist rather than be treated as ephemeral context.

How can I benchmark token usage before and after switching models?

Export the usage field from every Anthropic API response into a CSV (the script above does this automatically). Run the benchmark once on your current model and once on Fable 5.1 after restructuring your prompts. Compare the input, output, and cache columns across the two files. The cost_usd column gives you the per-task number directly.

What agent workflows benefit most from the 45% cost reduction?

Any workflow that repeatedly accesses the same context across turns sees the biggest gains. Tool orchestration agents (same tool definitions every turn), multi-step code review loops (same codebase each iteration), long-form research synthesis (same source documents per pass), and automated data pipelines with fixed schemas all have high cache-read potential. Workflows where every turn is genuinely unique context see smaller gains.

Is the 45% figure realistic for my workflow?

It depends on your cache-read share. Anthropic's 45% figure applies to workloads with high context repetition. If your agent re-sends a 2,000-token system prompt and tool list on every turn across a 20-turn session, your cache-read share is high and you'll approach that figure. If most of your context is fresh text each turn, your savings will be lower. The benchmarking script tells you exactly where you land.

What to Actually Do Next

Fable 5.1's cache pricing is real, but only if you measure first, then restructure. The three templates above cover the patterns responsible for most agentic token waste. Run the benchmark script on one workflow this week and see whether the cache-read column is actually lighting up. If it's not, your prompts need the structural changes shown in the before/after examples above. If it is, you have a real number to point at.

If you'd rather skip the setup work, Ultra Prompt's Fable 5.1 agentic templates are ready to import with the cache structure already built in.

Ready to level up your prompts?

Ultra Prompt has 1,000+ expert-crafted templates. Stop guessing, start prompting.

Try Ultra Prompt Free
S

Written by Sean

Founder of Ultra Prompt. Building the prompt engineering toolkit I wish existed.