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

# Usage and cost caps

> Understand how project-level Qodex-funded spend caps work and how BYOK changes what counts toward them.

# Usage and cost caps

Each project has rolling caps on Qodex-funded LLM spend.

The caps protect your project from accidental runaway usage. They apply only when Qodex is paying for the provider calls. If the project uses BYOK, those calls go to your provider account and do not count against the Qodex-funded cap.

## How rolling caps work

| Rule                  | What it means                                                 |
| --------------------- | ------------------------------------------------------------- |
| Rolling 5-hour window | Qodex looks at usage from the last 5 hours.                   |
| Rolling 7-day window  | Qodex also checks usage from the last 7 days.                 |
| No fixed reset        | Headroom returns continuously as old usage leaves the window. |
| Per project           | Usage in one project does not reduce another project's cap.   |

This means you do not need to wait for midnight or Monday. The countdown tells you when enough usage will roll off.

## Where to see usage

Open **Settings > Plan** in a project.

You will see:

* Current plan.
* 5-hour usage.
* 7-day usage.
* Time until headroom returns.
* Which usage is Qodex-funded and which is BYOK.

The chat cost view also shows usage while you are working with the agent.

## What happens at the cap

When a project reaches its cap:

* New chat runs pause with a clear cap message.
* Scheduled runs and PR reviews wait until headroom returns.
* In-progress runs stop at a safe boundary, save partial work, and mark the run as `budget_exceeded`.

`budget_exceeded` is separate from a test failure. It means the run stopped because of budget, not because the app failed.

## Per-run budget

Each test run also has its own token budget.

The project cap protects the whole project. The per-run budget protects one scan from consuming too much context or cost by itself.

At 80%, Qodex warns. At 100%, the run stops, saves partial output, and marks the run `budget_exceeded`.

## How to get unstuck

If you hit a cap:

1. Wait for usage to roll out of the window.
2. Add BYOK so new calls route through your provider key.
3. Upgrade the project plan.

For heavy security, exploration, or PR review work, BYOK is often the cleanest way to keep runs moving while retaining your own provider-level spend controls.

## Next steps

<CardGroup cols={2}>
  <Card title="Plans and pricing" icon="credit-card" href="/account-plans-and-pricing">
    See each plan's cap.
  </Card>

  <Card title="BYOK" icon="key" href="/integrations-byok">
    Use your own provider key.
  </Card>

  <Card title="Why is my scan slow?" icon="hourglass" href="/kb-why-is-my-scan-slow">
    Separate cost caps from scan runtime.
  </Card>

  <Card title="LLM cost on reruns" icon="repeat" href="/kb-llm-cost-on-reruns">
    Learn why reruns usually cost less.
  </Card>
</CardGroup>
