THE INDEPENDENT RECORD · AGENTIC AI AS A SERVICE AboutStandardsContact
GAASAGENTIC AI · AS A SERVICE
INDEPENDENT · SINCE 2026
UPDATED DAILY
NO HYPE · NO PAY-TO-PLAY
PER-TASK PRICING NOW STANDARD ● NEW BENCHMARK: 71% TASK COMPLETION ● ENTERPRISE PILOTS UP 4X ● RUNTIME FUNDING ACCELERATES ● "AGENTS ARE THE NEW SEATS" ● MARGINS UNDER PRESSURE ● THE INDEPENDENT RECORD ON GAAS
Economics

The Economics of Long-Running Agents: When a Task Takes Hours, Not Seconds

Most agent pricing was designed for tasks that finish before your coffee gets cold. But the highest-value work, migrating a codebase, running a multi-day research project, reconciling a quarter of invoices, unfolds over hours. When wall-clock time stretches, the cost curve bends in ways that break naive per-task math: idle waiting, memory you have to keep warm, retries that compound, and the awkward truth that a customer's job can sit blocked on a human for forty minutes while your meter keeps ticking. This piece walks through where the money actually goes in long-running agents, why the obvious mitigations don't fully work, and how to price work that refuses to fit in a request-response box.

By S. Bauer · Mar 21, 2026 · 13 min read

Table of Contents

The second-to-hour jump changes everything

A chatbot answers in two seconds. A long-running agent might churn for six hours, fire two hundred tool calls, spawn a handful of sub-agents, pause twice for human approval, and resume. Those aren't the same product with a longer progress bar. They have different cost structures, and pretending otherwise is how GaaS vendors quietly torch their margins.

The reason is simple but easy to miss. Short tasks are bursty and stateless. You pay for a slug of inference, return an answer, and the resources evaporate. Cost scales cleanly with volume, and you can reason about it the way you'd reason about an API call. Long-running tasks are the opposite: they're stateful, they're punctuated by waiting, and they hold resources hostage for the entire duration of the job, including the stretches where the agent is doing nothing but waiting on a slow API, a queued tool, or a human who went to lunch.

That shift from "cost per call" to "cost per hour of held state" is the entire story. Everything below is a consequence of it.

What actually costs money over hours

Inference is rarely the whole bill

Operators new to GaaS assume token spend dominates. For a long-running agent, it often doesn't, or at least it doesn't dominate the way you'd expect. A six-hour agent run might only spend forty minutes in active generation. The rest is tool execution, network round-trips, sandboxed code running, file I/O, and waiting.

Tokens still matter, and they matter in a sneaky way we'll get to. But if you build your whole cost model around input/output token pricing, you'll be blindsided by everything wrapped around the model. Anthropic's own guidance on building effective agents makes the point obliquely: the expensive, fragile part of an agent isn't the model call, it's the loop, the orchestration, the tool use, the decision to keep going. Loops cost wall-clock time, and wall-clock time is what you're really paying for.

The idle tax

Here's the line item nobody puts on the invoice: idle compute. A long-running agent frequently sits in a waiting state. It dispatched a web scrape that takes ninety seconds. It's blocked on a customer approving a refund. It kicked off a long-running database migration and is polling for completion.

During all of that, if your architecture keeps a container, a warm context window, or a reserved process alive, you're paying for capacity that's producing nothing. On a two-second task, idle is a rounding error. On a six-hour task where the agent is genuinely idle for half the duration, idle can be the single largest cost driver, and it's almost completely invisible in dashboards that only track token usage. We dig into this elsewhere in the cluster, because the way vendors hide idle cost is its own scandal, but for now just internalize that time spent waiting is time spent paying.

State you have to keep warm

Long agents accumulate state: a growing conversation history, retrieved documents, intermediate scratchpads, sub-agent results, vector lookups, cached tool outputs. That state lives somewhere, RAM, a KV store, a vector DB, a checkpoint on disk, and keeping it accessible across a multi-hour run costs money continuously, not per-call.

You can checkpoint and tear down to save money, but checkpointing has its own cost: serialization, storage writes, and the latency of rehydrating when the agent resumes. There's a genuine tradeoff here between paying to keep state warm and paying to repeatedly cold-start it, and the right answer depends entirely on how often the agent actually resumes. Most teams pick one strategy and never measure whether it's the cheap one for their workload.

Why retries and context growth compound with time

Two failure modes scale with duration in a way that's nastier than linear.

First, retries. A short task that fails just fails, you re-run it cheaply. A long task that fails at hour five has already burned five hours of compute, state, and tokens. If your retry logic restarts from scratch instead of from a checkpoint, you pay for those five hours again. And long agents fail more often, simply because they have more steps and more surface area for something to go sideways. The math is brutal: a 1% per-step failure rate is harmless over ten steps and a guaranteed disaster over five hundred. (The cluster's deep dive on the hidden cost of retries treats this as its own discipline, and it deserves to be.)

Second, context growth. As the agent runs, its context window fills with history, tool outputs, and reasoning traces. Because every model call re-processes the accumulated context, the per-step token cost rises as the run goes on. Step 200 is more expensive than step 2, not because the model changed but because it's now re-reading a novel's worth of accumulated state every single turn. Left unmanaged, a long agent's token cost grows quadratically with the number of steps, each new step adds to the context that every subsequent step must re-process. This is why aggressive context management (summarization, pruning, external memory) isn't a nice-to-have for long agents; it's the difference between a viable margin and a bonfire.

The pricing problem: per-task breaks down

GaaS has largely standardized on per-task or per-outcome pricing, and for short tasks it's defensible: cost variance per task is low, so a flat price carries acceptable risk. Long-running agents detonate that assumption.

The problem is variance. Two instances of "do my competitive research" might cost you wildly different amounts, one finishes in an hour against cooperative sources, the other grinds for five hours, spawns sub-agents, and hits three rate limits. If you charge a flat $40 per research task, you eat the difference on the bad runs and pray the good runs subsidize them. Sometimes they do. When a whale customer sends you nothing but pathologically hard jobs, they don't, and you're now paying your customer to use your product.

This is why long-running agents push vendors toward one of three uncomfortable options:

  1. Price the average and accept variance risk. Simple, customer-friendly, and it works until your customer mix skews hard. This is essentially insurance, and you'd better price like an actuary.
  2. Meter the resources directly, charge for agent-hours, tokens, or tool calls. Honest, margin-protective, and customers hate it because they can't forecast their bill, which is its own well-documented problem with consumption pricing.
  3. Hybrid: a base task fee plus overage above a complexity threshold. The least bad option for genuinely variable work, but it requires you to actually measure per-task cost, which most teams can't do yet.

There's no clean answer, and anyone selling you one is hiding the variance somewhere. The honest framing, which a16z has pushed in its writing on the new business of AI and shifting cost structures, is that AI-heavy businesses carry variable COGS that look more like a cloud or services business than classic software, and you have to price accordingly instead of pretending you have SaaS-grade gross margins.

Architectural levers that actually move the curve

If duration is the enemy, the strategies that help are the ones that reduce held time, reduce re-work, and reduce re-processing.

Checkpoint and suspend during idle. When the agent is blocked on a human or a slow external call, serialize its state and release the compute. Pay storage instead of paying for a warm idle process. This is the single highest-leverage change for human-in-the-loop workflows, where the agent can be parked for minutes or hours waiting on approval.

Cap autonomy and step count. A hard ceiling on steps, sub-agents, or wall-clock time turns an unbounded worst-case spend into a bounded one. Some vendors are quietly capping autonomy specifically to protect margin, and while it feels like a downgrade, it's often the rational move. An agent that runs forever is a budget grenade.

Manage context aggressively. Summarize old turns, offload bulk data to external memory and retrieve on demand, and prune tool outputs once they've been consumed. This directly attacks the quadratic token growth that kills long runs.

Use a tiered model strategy. Don't run the most expensive frontier model for every one of five hundred steps. Route routine sub-decisions to cheaper or open-weight models and reserve the frontier model for the steps that genuinely need it. Over hundreds of steps, the blended savings are enormous.

Cache relentlessly. Prompt caching, tool-output caching, and memoized sub-results matter far more in a long run than a short one, because long runs revisit the same context and the same tool calls repeatedly. Caching is one of the quietest levers on long-agent gross margin, and it's routinely underused.

A worked example: the four-hour research agent

Make it concrete. Suppose you sell a research agent at $50 per report. A typical run:

A naive estimate ("300 calls times average tokens") might peg cost at $12 and project a healthy margin. Reality bites in three places. Context growth means your average call is far more expensive than your early calls, so token spend lands closer to $22. The unhandled retry adds another chunk. And if you're keeping compute and state warm across the full four hours, including the idle waiting, infrastructure cost can rival or exceed the token cost. Suddenly your $50 report costs $38 to produce, and your "software" gross margin is 24%, not the 80% your board is expecting.

Now apply the levers. Checkpoint during idle and on failure: you stop paying for warm idle and you stop re-running the lost 90 minutes. Manage context: you cap late-run token bloat. Tier your models: 200 of those 300 calls drop to a cheaper model. The same report now costs maybe $16 to produce, and you're back to a margin you can defend. The difference between those two outcomes isn't the product, it's whether anyone modeled the economics of time. This is exactly why time-to-value measurement for autonomous deployments and per-task cost instrumentation aren't optional accessories; they're how you find out which of these two businesses you're actually running.

Insights Most People Overlook

Idle time, not compute time, is the real long-agent killer, and it's the easiest to fix. Everyone optimizes the active inference path because that's what the token dashboard shows. But on human-in-the-loop and tool-heavy workflows, the agent spends most of its life waiting, and a warm idle process bleeds money the whole time. Checkpoint-and-suspend during idle is often a bigger margin win than any model optimization, and almost nobody instruments for it because their cost tooling literally can't see waiting.

Long-running agents make the human the bottleneck, and the human's latency becomes your COGS. When an agent pauses for approval, the duration of that pause is set by your customer's responsiveness, not your engineering. A customer who takes two hours to approve a step is, under naive architecture, two hours of cost you eat. This inverts a core SaaS assumption: in software, the customer being slow costs you nothing. In long-running GaaS, customer behavior directly drives your cost-to-serve, which means slow customers are unprofitable customers, and you can't tell which is which without per-customer cost attribution.

Per-task pricing is a bet that your customer mix won't skew, and long tasks make the skew lethal. Flat pricing on high-variance work is insurance underwriting in disguise. For short tasks the variance is small enough to ignore. For multi-hour tasks, a single customer who sends only pathologically hard jobs can flip your unit economics negative while every dashboard still shows "healthy revenue." The danger isn't visible in aggregate, it hides at the cohort level, which is why this category needs cohort cost analysis the way SaaS needed cohort retention.

Falling token prices won't save long-agent margins, because duration costs aren't mostly tokens. There's an industry reflex that assumes cheaper inference fixes everything. But if half your cost is idle infrastructure, held state, and orchestration, halving the token price barely moves your total. Long-running agents are precisely the workload where the "tokens will get cheap" thesis fails hardest, because the bottleneck is wall-clock time, and time isn't getting cheaper.

The quadratic context tax means your longest, most valuable runs are your worst-margin runs by default. The jobs customers pay the most for, the deep, multi-hour, high-autonomy work, are exactly the jobs where context bloat compounds hardest and per-step cost climbs the steepest. Without aggressive context engineering, your premium product is also your lowest-margin product, which is the opposite of how you want a business to scale. The fix is mundane and unglamorous (summarize, prune, externalize memory), which is probably why so many teams skip it until the bill arrives.

References

#per-task agent pricing#gaas unit economics

More in Economics