cd /news/ai-agents/price-each-step-of-your-agent-before… · home › topics › ai-agents › article
[ARTICLE · art-181804] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Price each step of your agent before you pick a model tier

An engineer published a script that prices each step of an agent pipeline against Anthropic's standard rate card, letting teams compare model tiers before committing. Using example values of 2 million calls at 1,200 input and 20 output tokens, the script shows Haiku 5.5 costing $260 versus $20,800 for Fable 5.2, and it accounts for Haiku's higher long-context rates above 100,000 tokens and the 50 percent Batch API discount. The engineer notes that validation costs do not shrink with the model, since small models hallucinate as readily as large ones.

recommendation

Run the per-step cost script against your real logs before choosing a model tier, and remember Haiku 5.5 prompts over 100,000 tokens bill at 0.50/2.50 per million instead of 0.10/0.50.

more in playbook: Controlling LLM cost
by read1 min views1 publishedDec 4, 2026

Most agent pipelines send every step to one model. Usually it is the large one, picked because it passed the demo.

This post is the engineer's companion to our guide on small language models. It turns the cost section of that guide into a script you can run against your own logs.

The rates below are the Anthropic standard rate card in USD per million tokens, checked on 30 November 2026. Haiku 5.5 charges 0.10 for input and 0.50 for output, while Fable 5.2 charges 8.00 and 40.00. One catch. A Haiku 5.5 prompt over 100,000 tokens is billed at 0.50 and 2.50.

RATES = {  # USD per million tokens: (input, output)
    "haiku-5.5": (0.10, 0.50),
    "sonnet-5.5": (2.00, 10.00),
    "opus-5.5": (4.00, 20.00),
    "fable-5.2": (8.00, 40.00),
}
HAIKU_LONG = (0.50, 2.50)  # prompts over 100,000 tokens

def cost(model, tokens_in, tokens_out, batch=False):
    rate_in, rate_out = RATES[model]
    if model == "haiku-5.5" and tokens_in > 100_000:
        rate_in, rate_out = HAIKU_LONG
    usd = (tokens_in * rate_in + tokens_out * rate_out) / 1_000_000
    return usd * 0.5 if batch else usd

calls, tin, tout = 2_000_000, 1_200, 20
for m in ("haiku-5.5", "fable-5.2"):
    print(m, round(calls * cost(m, tin, tout), 2))

With those example values the script prints 260.0 for Haiku 5.5 and 20800.0 for Fable 5.2. Swap in the call count and token sizes of a real step from your logs. The batch flag applies the 50 percent Batch API discount for work that can wait.

Validation does not shrink with the model. A small model hallucinates as readily as a large one, so the test set stays the same size whichever tier wins.

The full guide has the decision table and two hybrid routing patterns: small language models.

── more in #ai-agents 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/price-each-step-of-y…] indexed:0 read:1min 2026-12-04 · —