> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sense-lab.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Limits and cost

> What a run can spend, how long it can take, and what it costs.

Every run has a spend limit, a time limit and a step limit. You can lower them for one run or in a definition. You cannot raise them above the ceilings.

| Limit | Default | Ceiling |
| - | - | - |
| Spend | \$5 | \$50 |
| Time | 30 minutes | 120 minutes |
| Steps for each attempt | 60 | 200 |
| Attempts | 1 | 5 |

A single command in the sandbox can run for up to 10 minutes. The computer has 2 CPUs and 4 GB of memory. A service started beside it has 1 CPU and 2 GB.

A batch has a limit for each task and a total for all of them. See [Several changes at once](https://docs.sense-lab.ai/sensei/runs/batches.md#options).

## How many runs at once

| Limit | Value |
| - | - |
| Runs queued or running for an account | 20. One more is refused until one finishes. A batch counts as one, whatever its tasks. |
| Runs working at the same moment for an account | 12. The others stay **Queued** until one ends. |
| Tasks of batches queued or working for an account | 400 |

How many runs work at the same moment also depends on how many computers are free. A run that waits for one is **Queued**, and the wait costs nothing.

When runs are waiting for a computer, the account with the fewest runs working goes first, and among its runs the oldest. A large batch on one account does not hold another account's single run behind it.

## Set limits

In a definition:

```yaml theme={null}
limit:
  usd: 0.50
  minutes: 10
  steps: 40
```

For one run:

```bash theme={null}
sensei run "Fix the failing test" --budget 2 --minutes 15 --steps 80
```

A limit given for one run overrides the definition's. In a run with steps, each step is also capped by what the parent has left.

## What a run costs

A run draws from the account's balance for three things.

| Item | Rate |
| - | - |
| Model calls | The token rates on [Usage and cost](https://docs.sense-lab.ai/sensei/usage-and-cost.md#rates) |
| Computer time | \$0.005 a minute, counted by the second while the computer is up |
| Services | \$0.0025 a minute for each service started beside the run, counted by the second while it is up |

The spend limit counts all three. A run that waits for a person holds no computer and no services, so the wait costs nothing.

The run's page shows the cost so far, split into the model, the computer and the services. **Usage & cost** has a **Computer time** figure for the month, which covers computers and services.

![The Budget card on a run's page: spend split into model, computer and services, time, commands, model calls, tokens and Served by](https://mintcdn.com/senselab/7GJRxwA5n_G2FDq5/images/sensei/run-budget.png?fit=max\&auto=format\&n=7GJRxwA5n_G2FDq5\&q=85\&s=184035658bc3af004aba6ab07b5e5355)

## When a run reaches a limit

| Limit reached | What happens |
| - | - |
| Spend or time | The run stops at the end of the command it is on. A model call in flight is dropped. |
| Steps | The attempt ends where it is |
| Credits used up | The run fails with the reason, and new runs are refused until you add credits |
| The key is over its requests per minute, or the model is busy | The run waits for the time the answer names and asks again. The timeline says so. A call that is still refused after 5 minutes of waiting ends the run. |

A run that a limit ended shows **Stopped at budget**, and its work so far stays on the page. Start it again with a higher limit, or use **Try again** and give it a hint.

A stop you ask for does cut the command in flight. See [Stop a run](https://docs.sense-lab.ai/sensei/runs/review.md#stop-a-run).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.