Use case

    Reduce agent token spend without downgrading the output

    Who this is for

    Teams running AI agents or LLM features in production whose monthly inference bill is growing faster than the usage behind it, and who don't know which workflow is responsible.

    What you'll walk away with

    Cost per workflow and per outcome, the three changes that cut it most, and a ceiling that stops a runaway agent before it becomes a finance conversation.

    Place yourself first

    Count how many of these describe your team today. The read underneath tells you where to start, so you don't spend the quarter fixing the wrong layer.

    • The model bill is a single line item with no per-feature breakdown.
    • One model handles every task, from classification to long-form generation.
    • Whole documents are pasted into context because trimming was never built.
    • Identical prompts are re-run constantly with no caching layer.
    • Retries happen automatically with no cap and no logging.
    • No alert fires until the invoice arrives.
    • Nobody can state the cost of one completed agent run.

    Early

    4+ symptoms: you have no cost telemetry. Instrument before optimizing anything.

    Building

    2-3 symptoms: routing and caching are the fast wins.

    Optimizing

    0-1 symptoms: tune context windows and batch offline work.

    What's actually going wrong

    One model for every job

    A frontier model classifies, extracts, summarises, and writes—because it was the one wired up first.

    What it costs
    Cheap, high-volume tasks are billed at the most expensive rate in the stack, and those tasks are usually the majority of calls.
    What fixing it looks like
    Route by task: small fast models for classification and extraction, larger models only for reasoning and final output.

    Context bloat

    Full transcripts, whole documents, and unused system scaffolding ship on every call.

    What it costs
    You pay per token on input too, so bloat is a multiplier on every single request.
    What fixing it looks like
    Retrieve the relevant slice, summarize history above a threshold, and strip boilerplate from system prompts.

    No caching

    The same question, embedding, or document summary is recomputed all day.

    What it costs
    Repeat spend for identical output, growing linearly with traffic.
    What fixing it looks like
    Prompt and embedding caches keyed on content hash, plus provider-side prompt caching where available.

    Unbounded retries and loops

    An agent retries on failure, re-reads its own output, and occasionally loops.

    What it costs
    A single bad run can cost more than a thousand good ones, and nothing stops it.
    What fixing it looks like
    Hard step limits, retry caps with backoff, and a per-run token budget that aborts and logs.

    No cost telemetry

    Spend is visible monthly, by provider, not by workflow.

    What it costs
    Optimization is guesswork and regressions are invisible until the next invoice.
    What fixing it looks like
    Log tokens and cost per run, per workflow, per user tier; alert on daily thresholds.

    Cost controls, in the order they pay back

    LayerWhat teams usually runWhere the gap is
    TelemetryProvider dashboard onlyNo per-workflow attribution.
    RoutingSingle modelCheap tasks billed at premium rates.
    CachingNoneIdentical calls repriced every time.
    ContextEverything, every callInput tokens dominate the bill.
    BatchingAll calls real-timeOffline work paying interactive prices.
    GuardrailsUnboundedOne loop can outspend a month of normal use.

    Pricing and features change constantly—always confirm current details on the vendor's own site before you buy.

    The first 90 days, with named deliverables

    1. 1

      Week 1-2—Instrument

      • Tokens and cost logged per run, workflow, and model
      • Cost-per-completed-outcome baseline for the top three workflows
      • Daily spend alert with a threshold you'd actually act on
    2. 2

      Week 3-6—Cut

      • Task-based model routing shipped for the highest-volume workflow
      • Prompt and embedding cache with hit-rate reporting
      • Context trimming: retrieval slices and rolling summaries
    3. 3

      Week 7-12—Hold the line

      • Per-run token budget with abort and log on breach
      • Batch queue for anything that doesn't need to be interactive
      • Quality regression checks so cost cuts don't quietly degrade output

    Teams we've done this with

    Questions operators ask us

    Does cutting token spend mean worse output?

    Only if you downgrade the model doing the reasoning. Most savings come from tasks that never needed a frontier model, context that never needed to be sent, and calls that never needed to be repeated. Pair every change with a quality check on a fixed evaluation set and you keep the output while the bill falls.

    What's the fastest single change?

    Routing by task. Moving classification, extraction, and tagging to a small fast model typically removes the largest share of calls from your most expensive line, and it can usually ship in days rather than weeks.

    How do we stop a runaway agent?

    A per-run token budget plus a hard step limit. The run aborts, logs its state, and alerts—instead of looping until someone notices the invoice.

    Want to build this in-house first?