Real World Example

The Problem

Payment companies like Razorpay and PhonePe handle huge volumes of support chats about failed UPI payments, refunds and settlements. When a chat is escalated, a human agent must read the whole conversation before helping. A three-bullet summary at the top saves each agent a minute or two per ticket, which across lakhs of tickets is a large saving.

Before building it, the team must answer a business question: what will this cost per month, and which model is good enough? Guessing is risky because fintech chats contain many IDs, amounts and Hinglish phrases, which tokenize worse than plain English. So they measure real token counts on real (anonymised) samples first, then build the budget from the measurement.

Budgeting a Fintech Support Summarizer

Step 1: measure the average input size with the token counting endpoint:

import anthropic

client = anthropic.Anthropic()
sample_chats = load_sample_chats()          # your 50 real (anonymized) chats

counts = [
    client.messages.count_tokens(
        model="claude-haiku-5-5",
        system="Summarize this support chat in 3 bullet points for an agent.",
        messages=[{"role": "user", "content": chat}],
    ).input_tokens
    for chat in sample_chats
]
print("average input tokens:", sum(counts) // len(counts))

Run it

python measure.py

Example output

average input tokens: 2140

Turning Measurements into a Budget

Example

With the measured average (2,140 input tokens) and a typical summary length (120 tokens), compare models for 1 lakh chats per day:

PRICES = {"claude-opus-5-5": (4.00, 20.00), "claude-sonnet-5-5": (2.00, 10.00), "claude-haiku-5-5": (0.10, 0.50)}
avg_in, avg_out, chats_per_day = 2_140, 120, 100_000

for model, (pin, pout) in PRICES.items():
    per_chat = avg_in * pin / 1e6 + avg_out * pout / 1e6
    monthly = per_chat * chats_per_day * 30
    print(f"{model:18} USD {per_chat:.5f}/chat  USD {monthly:>9,.0f}/month")

Output

claude-opus-5-5    USD 0.01096/chat  USD    32,880/month
claude-sonnet-5-5  USD 0.00548/chat  USD    16,440/month
claude-haiku-5-5   USD 0.00027/chat  USD       822/month

The team would test summary quality on the cheapest model first and only move up if quality is not good enough. That simple habit often cuts the AI bill by 10–40×.

Note: Input tokens dominate this workload (2,140 in vs 120 out), so the input price matters most here. For a writing task with long outputs, the output price would dominate instead. Always look at which side of the bill is bigger before optimising.

Summary

The method generalises to any GenAI feature: measure token counts on a realistic sample with the real tokenizer, decide the expected output length, multiply by price and volume, and compare models. Doing this before writing the feature avoids the common surprise of a demo that costs little and a launch that costs lakhs per month.

  • Measure real token counts on real (anonymised) samples; do not guess from English word counts.
  • Cost per call × calls per day × 30 gives the monthly bill.
  • Check whether input or output dominates, then optimise that side.
  • Start with the cheapest model and move up only if quality fails your test.