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

# Cost and limits

> Daily spend caps, hourly rate caps, model choice, and BYO key.

Every agent has two server-enforced limits: a **daily spend cap** (soft pause) and an **hourly action cap** (hard pause). Both are configured per-agent. Neither can be exceeded — the runtime checks before each LLM call and before each mutating tool call.

## Daily spend cap

| Property          | Value                                             |
| ----------------- | ------------------------------------------------- |
| Default           | \$5.00 (500 cents)                                |
| Type              | Soft pause — auto-resumes                         |
| Resume            | At 00:00 in the workspace timezone (configurable) |
| Status            | `PAUSED_COST`                                     |
| User notification | Email + any channels subscribed to `on_pause`     |

The runtime maintains `agent_cost_ledger` per (agent, day, provider, model). Before each LLM call, the **CostGovernor** computes `estimated_cost = prompt_tokens × 1.2 × per-token price` and refuses if `ledger_today + estimated > cap`. Refusal sets `status=PAUSED_COST`, files a `COST_PAUSE` pending item, and exits the cycle.

## Hourly action cap

| Property          | Value                                         |
| ----------------- | --------------------------------------------- |
| Default           | 60 actions/hour                               |
| Type              | Hard pause — requires human resume            |
| Status            | `PAUSED_RATE`                                 |
| Backing           | Redis sliding-window counter                  |
| User notification | Email + any channels subscribed to `on_pause` |

An "action" is any mutating tool call (everything in the *Mutating* category in [Rules and decisions](/agents/rules-and-decisions)). Read-only tools don't count. The cap exists to prevent runaway loops — a misbehaving prompt that retries the same action 100 times gets stopped at 60.

## 80% warning

When daily spend crosses 80% of the cap, the agent fires a `on_cost_threshold` notification. The UI shows an *"approaching cap"* banner on the agent header.

Configurable via the rule set:

```json theme={null}
"notifications": {
  "on_cost_threshold_pct": 80
}
```

## Model choice

| Model                                   | Use                                                    | Cost (relative)        |
| --------------------------------------- | ------------------------------------------------------ | ---------------------- |
| `claude-opus-4-7` (default)             | Planning loops, escalation triage, user-initiated chat | 1×                     |
| `claude-haiku-4-5-20251001` (fast path) | Routine event-triggered cycles                         | \~0.1×                 |
| `gpt-4.1` (BYO)                         | When `llmProvider = BYO_OPENAI`                        | Your account's pricing |
| Other `claude-*` (BYO)                  | When `llmProvider = BYO_ANTHROPIC`                     | Your account's pricing |

The fast path is opt-in via the rule set:

```json theme={null}
"runtime": {
  "use_fast_model_for_routine_cycles": true
}
```

Default `true`. Saves \~10× on the common (event-driven) path.

## BYO key

Bring your own Anthropic or OpenAI API key. We never bill you for usage on the BYO path — your account is charged by the provider directly.

See the full walkthrough: [BYO Anthropic key](/agents/recipes/byo-anthropic-key).

## Pro Max downgrade

If your workspace downgrades off Pro Max, all `ACTIVE` agents move to `PAUSED_USER` with reason `"Plan downgraded — Pro Max required"`. The agent rows stay in the database — re-upgrade reactivates them with config intact, including rule sets, channels, data sources, and pending items. Memory notes and run history persist throughout.

## Cost dashboard

Two views in the app:

* `/workspace/agent-costs` — workspace-wide MTD total, sum of caps, projection.
* `/agents/{id}/costs` — per-agent breakdown by day and model.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/mappingtravel/images/agents/cost-dashboard.png" alt="Cost dashboard" />

## API

| Endpoint                                   | Returns                                    |
| ------------------------------------------ | ------------------------------------------ |
| `GET /api/v1/workspaces/{wid}/agent-costs` | Workspace aggregate + per-agent rollup.    |
| `GET /api/v1/agents/{id}/costs`            | Per-day breakdown, MTD vs cap, projection. |

## Related

* [Agents overview](/agents/overview) — trust-by-design context for the caps.
* [Recipe: Pause when cost spikes](/agents/recipes/pause-when-cost-spikes) — wire alerts so you hear about it before the cap fires.
