Blog
/
Industry Insights

When Your Customer's Agent Hits the Limit at 2am: How OpenAI, WRITER and Temporal Handle It

Agents work through the night and use up every quota. Why a hard stop becomes an outage, and why the task budget has to be separate from the account balance.

Sagi Bracha Sagi Bracha
Written by
Sagi Bracha
Last updated
December 2, 2026
read time
7
minutes
When your customer's agent hits the limit at 2am: how OpenAI, WRITER and Temporal handle it

Table of contents

At 11pm, Alice hands her coding agent a task: fix the bug that will stop lunch from reaching 500 people at tomorrow's hackathon, and make all the tests pass. Then she goes to bed. At 2:13am the agent is still working, one test is still red, and her balance is empty. Her $10 plan quota is gone, and so are the $5 of credits she had already bought. The work is urgent, but the agent has no permission to buy more credits or upgrade her plan, and Alice is asleep, so nobody can grant it.

Jonah Cohen, Tech Lead for Financial Engineering at OpenAI, opened his talk at After Tokens with this scenario. Once agents do the work, hitting the limit is the normal path through a product, and most usage stacks were not designed for that.

TL;DR

  • Agents run nonstop and split one task into thousands of requests, so teams are replacing per-feature counters with one credit pool: plan quota first, then purchased credits.
  • OpenAI, WRITER and Temporal avoid hard stops in production, since a cutoff is an outage, and handle overruns after the fact, with alerts, invoices or refunds.
  • Without a cutoff, an unattended agent has no ceiling, so the task budget has to be separate from the account balance: set by the customer, capped per agent, enforced in the request path, with the agent pausing at a resumable point, or topping up if the customer pre-approved it.

Quotas were priced for people who eat and sleep

SaaS plans have always included more than people use. Cohen's example was deep research: a plan might include 10 tasks a month, but in most months people run far fewer. They spike when they plan a trip or a wedding, then go quiet again. Humans eat, sleep and have other things going on, so utilization stays low and nobody notices the headroom. Agents use all of that headroom. They work around the clock and use whatever quota they're given: "They don't eat, they don't sleep, and they will just chew through your token budget," Cohen said. And there are more of them every week.

Peter Walker, Head of Insights at OpenRouter, which serves around 190 trillion tokens a week, reported that agents passed humans in token usage on February 6, 2026, and have stayed ahead ever since. Hitting a limit used to mean a failure and a bad user experience. With agents it happens every day, so the design question becomes what your system does when a customer reaches the limit.

From separate counters to one shared pool

The first thing that breaks is the unit. Limits like 30 messages a day or 10 images a day make sense to a person. They make no sense to an agent that might split one task into a single request, ten requests or a thousand, and run all night. So the industry is moving from separate counters to a single shared quota. Text, images, tool calls and different models each have their own rate card, and every request is priced into a common unit that draws down a single balance. In Alice's case, her $10 can cover code generation, web search or images, in any mix.

The same shift is happening beyond the model labs. Kyle Poyar, founder of Growth Unhinged and an advisor to AI startups on pricing, sees companies with complex hybrid pricing move to a single credit model: the customer buys one pool of credits and draws it down across any product, the way a law firm retainer works. The order in which that balance is spent matters as much as the unit. Cohen described a fixed order for drawing it down:

One credit balance spent in a fixed order: $10 plan quota, then $5 purchased credits, then at the limit the options are upgrade the plan, wait for the reset, turn on top-ups or buy more credits

A single task can move from quota to credits without a pause. Cohen gave voice mode as an example: a conversation starts on the plan quota, and if it keeps going after the quota runs out, it continues on credits instead of ending. Both sources use the same pricing and the same accounting, so the user never sees the switch.

A hard stop is an outage

If limits are normal, what happens at the limit is a product decision. At After Tokens, OpenAI, WRITER and Temporal, three companies at different layers of the stack, all made the same one: don't cut the customer off. A spend cap that cuts the customer off takes their product down. OpenAI's API used to stop customers at the spend limit they set, and Cohen said of the result: "It was an outage, which was crazy." OpenAI has since moved to soft limits and warnings.

The more critical the work, the less acceptable a cutoff becomes. Matan-Paul Shetrit, SVP Product at WRITER, described its agents working on S-1 filings for some of the largest banks in the world. Instead of cutting those customers off, WRITER alerts the customer and its own sales team at 70 or 80% of capacity, invoices modest overages in arrears, and turns large ones into a commercial conversation.

Hard limits still work outside production. Tomas Lorinc, Sr Staff Product Manager for Monetization at Temporal, sees them working in development and staging. In production, a budget cap that takes an application down is unacceptable, and Temporal would rather refund an accidental overrun.

Limit policy by environment: hard limits in development and staging; in production, chat users get a prompt to buy more or upgrade, while agents get a soft limit inside a customer-set task budget, then a pause or a pre-approved top-up

Agents make the choice harder, because the user is away. In chat, a limit is harmless: the user is there to buy more. With an agent, a hard stop leaves the task half done, and a soft limit leaves it spending with nobody watching. Neither works without a budget the customer sets before the agent starts.

An agent hits its usage limit at 2:13am with one test still red. Three options: stop the agent and leave the task half done, add more credits and keep spending with no ceiling, or set a task budget so it runs up to the budget, then pauses

Separate the balance from the budget

The fix is to separate two numbers that most systems treat as one: the balance, which is how much money is in the account, and the budget, which is how much this specific task is worth to the customer.

The balance decides what the agent can spend; the budget decides what it should.

Only the customer can set that budget, because only they know what the outcome is worth. Cohen's example: a bug that only affects Alice's own lunch is worth less to her than one that stops 500 people at a hackathon from eating, although the model does the same work for both. So the budget is set when the task starts, and it can be higher or lower than whatever is left in the balance. That budget is part of what the agent is allowed to do. Shetrit put it this way: "The permission model is not just what can they access, but also what can they spend."

In practice, the agent reserves its budget when the task starts, the way a card authorization holds an amount, and settles the real cost when it finishes. When it reaches that budget mid-task, it should pause at a point where the work can resume once someone with authority approves more budget. It then continues from where it stopped instead of paying again for work it already did.

Automatic top-ups let the customer give that approval in advance. Cohen described letting users turn them on, so when the credit balance dips, more credits are bought without committing to a bigger monthly plan. With top-ups on, Alice wakes up to a fixed bug instead of a stalled task. With a budget and top-up rules in place, the limit becomes a decision the customer made in advance, and it is clear who can change it.

The limit has to be decided before the agent spends

When limits are routine, none of the decisions about them can wait for the invoice. They have to happen in the request path, before the agent spends. Put together, the talks point to six things a usage stack has to do:

  • Price every kind of work into one balance, so text, images, tools and models draw from the same pool.
  • Spend funding sources in a fixed order, plan quota first and purchased credits after.
  • Keep the work running past zero wherever a cutoff would cause an outage.
  • Refill automatically when the customer has approved top-ups in advance.
  • Hold a budget for each task before it starts, set by the customer.
  • Give each agent its own spending limit, as part of its permissions.

In code, a task budget looks like this:

// Reserve the task budget before the agent starts
const { data } = await client.v1.customers.checkEntitlement(customerId, {
  currencyId: 'currency-ai-credits',
  reserveAmount: taskBudget,   // set by the customer
  reservationId: taskId,       // a retry with the same ID is applied once
});

if (!data.isGranted) {
  return pauseTask(taskId, data.accessDeniedReason); // wait for approval or a top-up
}

const used = await runAgent(task);

// Settle the real cost; whatever wasn't used returns to the balance
await client.v1.credits.reservations.release(taskId, {
  customerId,
  currencyId: 'currency-ai-credits',
  consumedAmount: used,
});

Two engineering details matter here: the check runs in the request path, so it has to return in milliseconds, and every reserve and settle call carries an idempotency key, so a retried request is counted once. This decision layer works alongside billing. Invoices go out as they do today; the change is that the spend decision happens before the agent runs instead of at invoice time. Stigg handles it in the request path: credit pools, funding-order rules, per-task budgets and auto top-ups. See how it works in the docs.

Ask Alice before she goes to sleep

It's better to ask Alice before she goes to sleep than to cut her off, as Cohen put it. How are you handling budgets for your customers' agents? We're collecting patterns.

Latest news.

One email per month.
From engineers, for engineers.

Thank you! Your submission has been received.
Oops! Something went wrong while submitting the form.