---
title: "Cap what a single agent run can cost"
description: "Set Max cost per run and Max steps per run for a custom agent, what happens at 75% and 100% of the budget, and how to pick the numbers."
url: https://help.gleap.ai/en/articles/256-cap-what-a-single-agent-run-can-cost
collection: "Custom AI agents and skills"
updated: 2026-11-01
language: en
---

# Cap what a single agent run can cost

Set Max cost per run and Max steps per run for a custom agent, what happens at 75% and 100% of the budget, and how to pick the numbers.

A custom agent decides for itself how many steps a task needs. Usually that's a handful. Now and then it's a loop that keeps calling tools and thinking again. Two limits stop that from turning into a surprise: a cost limit and a step limit, both per run.

### Set the limits

1.  Open the agent under **AI agents** and go to **Settings → Model**.
    
2.  Enter **Max cost per run (USD)**. It starts at 1.
    
3.  Enter **Max steps per run**. It starts at 100 and can be set from 4 to 200.
    

Changes save automatically.

![Custom agent model screen in the Pied Piper demo project.](https://staticfiles.gleap.io/p613b5dd730aed737108f87ab/4DXU6c7YZ9MdHwO0Pc3k6sYvcvpAqbJxSondrN29qPHIAAXIii7kUsOm4UhRyRrtXpha7Ch8pSR.png)

Both limits apply to one run, not to a day or a month. An agent triggered a thousand times can still spend a thousand times the cap. The limits protect you against one bad run. A trigger's frequency is what controls volume.

### What happens as the budget fills

-   At three quarters of the cost limit, the agent is told it's running out and asked to wrap up. It usually finishes cleanly, so many runs that would have been cut off end properly.
    
-   At the limit, the run stops and is recorded as budget exceeded. That's its own outcome, separate from a general failure, so you can tell the two apart when you review runs.
    

### The step limit

Every reasoning step and tool call counts towards **Max steps per run**. It catches an agent that loops cheaply, where the cost limit would take a long time to kick in. A run that reaches it is recorded as step limit exceeded.

Read that as a sign the task was too broad or the instructions gave the agent no clear finishing point. Narrowing the job, or splitting it between two agents, fixes it more reliably than raising the number.

### Choosing the numbers

Base them on what the agent really needs, then leave some headroom.

-   An agent that tags a ticket or moves it between lanes makes one or two model calls. The defaults are far above what it needs, and lowering them makes a loop show up fast.
    
-   An agent that reads a long thread, calls several tools and writes a careful reply may need more, especially on an expensive model.
    

> **Info:** If runs keep stopping at a limit, find out why before you raise it. A repeated budget or step stop is usually a symptom: a tool that returns too much data, an instruction that sends the agent in circles, or a task that should be split. Raising the limit makes the same problem more expensive.

### Related

-   [How an agent run can end](https://help.gleap.ai/en/articles/257-how-an-agent-run-can-end.md)
    
-   [Decide what starts an agent](https://help.gleap.ai/en/articles/252-decide-what-starts-an-agent.md)
    
-   [Plans, seats and AI credits](https://help.gleap.ai/en/articles/377-plans-seats-and-ai-credits.md)
