docs: describe budgets as they work today (#22784)

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - Operators control what agents spend with budgets, and the public
docs explain how budgets work
> - The budget docs were last changed in March 2026. The budget system
was rebuilt after that
> - The docs still describe a fixed 80% alert and a 100% auto-pause on
company and agent budgets only
> - The docs do not say that budgets count billed dollars only.
Subscription usage is recorded at zero cents, so a budget never stops an
agent that runs on a subscription
> - An operator who reads the docs today can believe that a budget
protects a subscription. It does not
> - This pull request updates the cost and budget docs to match the code
on `master`. It changes docs only
> - The benefit is that operators and agent developers get a correct
description of what a budget does and does not do

## Linked Issues or Issue Description

Refs #8856

Related open pull requests. None of them changes these docs: #22745,
#13379, #11511, #17356.

**Issue type**

Outdated content.

**Where is the issue?**

- `docs/guides/board-operator/costs-and-budgets.md`
- `docs/api/costs.md`
- The budget lines in `docs/guides/board-operator/managing-agents.md`,
`docs/guides/board-operator/dashboard.md`,
`docs/guides/board-operator/creating-a-company.md`,
`docs/start/core-concepts.md`, and
`docs/guides/agent-developer/cost-reporting.md`

**What's wrong?**

The docs describe the budget system as it was in March 2026. Seven
points are wrong or missing. Each point is listed under Verification
with the code that supports the new text.

**Suggested fix**

Update the docs to describe the behavior of the code on `master`. Do not
change product code.

## What Changed

- `costs-and-budgets.md`: added a warning at the top. A budget counts
billed dollars only, and it does not stop an agent that runs on a
subscription.
- `costs-and-budgets.md`: added the three budget scopes (company, agent,
project) and their windows.
- `costs-and-budgets.md`: added the budget settings and their defaults
(`warnPercent`, `notifyEnabled`, `hardStopEnabled`, `reservationCents`,
`unpricedUsagePolicy`).
- `costs-and-budgets.md`: rewrote the enforcement section. It now
describes the warning, the hard stop, the budget incident, the two ways
to resolve it, and the monthly reset.
- `costs-and-budgets.md`: added where to set a budget in the UI and with
the API. It says that the older `budgetMonthlyCents` fields still work.
- `costs-and-budgets.md`: added sections for the reserve per run, usage
with no reliable price, the Subscriptions card, and provider quota
windows.
- `docs/api/costs.md`: added the budget overview, budget policy, and
incident routes, the report period parameters, and the subscription and
quota routes. Added the required `occurredAt` field to the cost event
example.
- The five related guides: corrected the lines that repeated the old
claims. Each one now links to the main guide.

## Verification

I read the code on `origin/master` at commit `0731cd3afc`. I did not run
the product. Each point below has the file and line that supports the
new text.

1. **Budgets exist for a company, an agent, and a project. A project
budget uses a lifetime window.** Corrected.
   - Scopes: `packages/shared/src/constants.ts:1050`
- The service uses `lifetime` for a project when no window is given:
`server/src/services/budgets.ts:862`
- The project page sends `lifetime`:
`ui/src/pages/ProjectDetail.tsx:658`
- The request validator fills in `calendar_month_utc` when the field is
absent: `packages/shared/src/validators/budget.ts:14`. The docs
therefore tell API callers to send `"windowKind": "lifetime"` for a
project.
2. **Budgets count dollars only. Subscription usage is recorded at zero
cents.** Corrected, and stated at the top of the guide.
- The only metric is `billed_cents`:
`packages/shared/src/constants.ts:1053`
- `subscription_included` is billed at 0:
`server/src/services/heartbeat/run-state.ts:522`
- Budget exposure counts it as 0:
`server/src/services/budget-exposure.ts:33`
- Claude Code and Codex report subscription billing when no API key is
set: `packages/adapters/claude-local/src/server/execute.ts:176`,
`packages/adapters/codex-local/src/server/execute.ts:204`
3. **The warning threshold and the hard stop are settings.** Corrected.
- Defaults `warnPercent` 80 and `hardStopEnabled` true:
`server/src/services/budgets.ts:912`
- `warnPercent` accepts 1 to 99:
`packages/shared/src/validators/budget.ts:17`
- The UI shows `warnPercent` but has no control to change it:
`ui/src/components/BudgetPolicyCard.tsx:108`
4. **At the hard stop, new work is refused, running work is told to
stop, and an incident opens.** Corrected.
- Incident, pause, and cancellation:
`server/src/services/budgets.ts:770`
   - New work is refused: `server/src/services/budgets.ts:825`
- Raise the budget or keep the scope paused:
`server/src/services/budgets.ts:1045`
- **A new month does resume a paused scope.** The budget worker
reconciles held monthly scopes at the end of the UTC month:
`server/src/services/budgets.ts:1329` and
`server/src/services/budget-enforcement-worker.ts:44`. With no spend in
the new window, the service closes the incident and removes the budget
pause: `server/src/services/budgets.ts:716`. This also applies after
"Keep paused". A manual pause stays. A lifetime budget does not reset.
5. **The "focus on critical tasks" text at 80% is skill guidance.**
Corrected.
   - The text is in the skill: `skills/paperclip/SKILL.md:681`
- At the soft threshold the server opens an incident and writes an
activity entry. It sends nothing to the agent:
`server/src/services/budgets.ts:750`
6. **Where to set a budget.** Corrected.
- Routes: `server/src/routes/costs.ts:347` (overview), `:355`
(policies), `:367` (resolve incident), `:399` (company), `:418` (agent)
- UI: `ui/src/pages/audit/audit-navigation.ts:11`,
`ui/src/pages/Costs.tsx:745`, `ui/src/pages/ProjectDetail.tsx:876`,
`ui/src/pages/AgentDetail.production.tsx:186`
- **The old fields still work.** `PATCH /companies/:id` with
`budgetMonthlyCents`: `server/src/services/companies.ts:430`. `PATCH
/agents/:id` with `budgetMonthlyCents`:
`server/src/services/agent-configuration.ts:196`. On an agent the change
needs a board user: `server/src/routes/agents.ts:5637`.
7. **Reserve per run, unpriced-usage policy, Subscriptions, and quota
windows.** Added.
- Reserve per run: `ui/src/components/BudgetPolicyCard.tsx:61`,
`server/src/services/budget-reservations.ts:160`
   - Unpriced-usage policy: `server/src/services/budgets.ts:244`
- Subscriptions: `server/src/routes/costs.ts:114`,
`ui/src/components/SubscriptionCostCard.tsx:113`
- Quota windows: `server/src/routes/costs.ts:332`,
`packages/shared/src/types/quota.ts:2`

Could not confirm:

- I took the UI paths from the code and from
`maps/feature-map/budgets-costs.md`. I did not check them on a running
instance.
- I found no UI control that creates the first company budget. The
Budgets page edits a company budget that exists. The docs say to create
it with the API. A maintainer who knows the UI should confirm this
sentence.
- I did not find an adapter that reports `subscription_overage`. The
docs say only that such usage counts for its reported cost.

Checks:

- `pnpm verify` exits with code 2. It reports a global CI input change
(`docs/api/costs.md`), so required CI supplies the broad coverage. I did
not run the full local suite.
- I checked every internal link and anchor in the seven changed files
with a script. All resolve.
- `git diff --check` reports no whitespace errors.
- No test reads the changed files.

## Risks

Low risk. The change is docs only.

- A wrong sentence in these docs can mislead an operator about spend.
The two sentences that most need a maintainer's review are the monthly
resume (point 4) and the company budget in the UI (see "Could not
confirm").
- `docs/guides/board-operator/delegation.md` still says that a CEO above
80% of its budget focuses on critical tasks. That is the skill guidance
from point 5. I did not change that file.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected — check the roadmap
first. See `CONTRIBUTING.md`.

## Model Used

- Claude Fable 5.2 (Anthropic), model ID `claude-fable-5-2`, in Claude
Code. Extended thinking and tool use (file read, search, shell, `gh`).
The model read the code, wrote the docs, and wrote this description.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [ ] I have run tests locally and they pass — *docs only. No test reads
these files. `pnpm verify` asks for required CI*
- [ ] I have added or updated tests where applicable — *not applicable.
Docs only*
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green — *pending on this PR*
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups —
*pending on this PR*
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Michael NguyenandClaude Fable 5.2 authored and GitHub committed 2026-11-24 14:25:24 -08:00
1 parent 3128be7cda
commit 455462812a
7 files changed
+324 -47

No files matched your search

+93 -10
View File
@@ -5,6 +5,8 @@ summary: Cost events, summaries, and budget management
Track token usage and spending across agents, projects, and the company.
For how budgets behave, see [Costs and Budgets](/guides/board-operator/costs-and-budgets).
## Report Cost Event
```
@@ -15,11 +17,17 @@ POST /api/companies/{companyId}/cost-events
"model": "claude-sonnet-4-20250514",
"inputTokens": 15000,
"outputTokens": 3000,
"costCents": 12
"costCents": 12,
"billingType": "metered_api",
"occurredAt": "2026-11-24T10:00:00Z"
}
```
Typically reported automatically by adapters after each heartbeat.
`occurredAt` is required. `billingType` is optional and defaults to `unknown`. Its values are `metered_api`, `subscription_included`, `subscription_overage`, `credits`, `fixed`, and `unknown`.
An agent can report only its own costs.
Typically reported automatically by adapters after each heartbeat. Adapters record usage that is included in a subscription with the billing type `subscription_included` and a cost of 0 cents.
## Company Cost Summary
@@ -27,7 +35,7 @@ Typically reported automatically by adapters after each heartbeat.
GET /api/companies/{companyId}/costs/summary
```
Returns total spend, budget, and utilization for the current month.
Returns total spend, the monthly company budget, and utilization.
## Costs by Agent
@@ -35,7 +43,7 @@ Returns total spend, budget, and utilization for the current month.
GET /api/companies/{companyId}/costs/by-agent
```
Returns per-agent cost breakdown for the current month.
Returns per-agent cost breakdown.
## Costs by Project
@@ -43,29 +51,104 @@ Returns per-agent cost breakdown for the current month.
GET /api/companies/{companyId}/costs/by-project
```
Returns per-project cost breakdown for the current month.
Returns per-project cost breakdown.
## Report Period
The cost reports above use the current UTC calendar month by default. To change the period, add query parameters:
- `from` and `to` — an ISO date or an ISO date-time with an offset
- `period=all` — all recorded costs. Do not combine it with `from` or `to`
## Subscriptions and Provider Quota
```
GET /api/companies/{companyId}/costs/subscriptions
GET /api/companies/{companyId}/costs/quota-windows
```
`costs/subscriptions` returns the subscription accounts that the caller can see, with their monthly fees. `costs/quota-windows` returns the quota windows that each connected subscription provider reports, with the percent used and the reset time.
Both are board-only. Both are separate from budgets.
## Budget Management
A budget is a budget policy on one scope: `company`, `agent`, or `project`. Only board users can change budgets.
Budgets count billed cost in cents (`billed_cents`). Usage with the billing type `subscription_included` has a cost of 0 cents, so a budget does not stop an agent that runs on a subscription.
### Budget Overview
```
GET /api/companies/{companyId}/budgets/overview
```
Returns every budget policy with its observed spend, status (`ok`, `warning`, or `hard_stop`), and window. Also returns the open budget incidents and the number of paused agents and projects.
### Set Company Budget
```
PATCH /api/companies/{companyId}
PATCH /api/companies/{companyId}/budgets
{ "budgetMonthlyCents": 100000 }
```
### Set Agent Budget
```
PATCH /api/agents/{agentId}
PATCH /api/agents/{agentId}/budgets
{ "budgetMonthlyCents": 5000 }
```
Both calls set a budget for the UTC calendar month. A value of `0` turns the budget off.
`PATCH /api/companies/{companyId}` and `PATCH /api/agents/{agentId}` still accept `budgetMonthlyCents` and set the same budget.
### Set Any Budget Policy
```
POST /api/companies/{companyId}/budgets/policies
{
"scopeType": "project",
"scopeId": "{projectId}",
"windowKind": "lifetime",
"amount": 20000
}
```
| Field | Default | Meaning |
|-------|---------|---------|
| `scopeType` | — | `company`, `agent`, or `project`. Required |
| `scopeId` | — | The ID of the company, agent, or project. Required |
| `windowKind` | `calendar_month_utc` | `calendar_month_utc` or `lifetime` |
| `amount` | — | The limit in cents. Required for a new policy. `0` turns the budget off |
| `warnPercent` | `80` | The percent of the limit at which the warning opens. From 1 to 99 |
| `notifyEnabled` | `true` | Whether the warning opens |
| `hardStopEnabled` | `true` | Whether work stops when spend reaches the limit |
| `reservationCents` | `0` | An estimate held against the budget before each run starts |
| `unpricedUsagePolicy` | `block` | `block` or `allow`. What to do when usage has no reliable price |
| `isActive` | `true` | Set `false` to turn the policy off and keep its amount |
A scope has one policy for each window kind. A second call with the same scope and window updates the policy. Fields you leave out keep their value.
The project page in the UI sets project budgets with the `lifetime` window. If you leave `windowKind` out of this call, the policy uses `calendar_month_utc`.
### Resolve a Budget Incident
```
POST /api/companies/{companyId}/budget-incidents/{incidentId}/resolve
{ "action": "raise_budget_and_resume", "amount": 150000 }
```
| Action | Effect |
|--------|--------|
| `raise_budget_and_resume` | Sets the limit to `amount`, removes the budget pause, and continues the runs that the hard stop cancelled. `amount` is required and must be more than the observed spend |
| `keep_paused` | Dismisses the incident. The scope stays paused |
## Budget Enforcement
| Threshold | Effect |
|-----------|--------|
| 80% | Soft alert — agent should focus on critical tasks |
| 100% | Hard stop — agent is auto-paused |
| `warnPercent` of the limit (default 80%) | A warning incident opens. Work continues |
| 100% of the limit, when `hardStopEnabled` is on (default) | A hard-stop incident opens. The scope is paused with the pause reason `budget`. New runs are refused and running work is told to stop |
Budget windows reset on the first of each month (UTC).
Monthly windows reset on the first of each month (UTC). At the reset, Paperclip closes the open incident of a monthly budget and removes its budget pause. A `lifetime` budget does not reset.
+17 -2
View File
@@ -74,10 +74,20 @@ POST /api/companies/{companyId}/cost-events
"model": "claude-sonnet-4-20250514",
"inputTokens": 15000,
"outputTokens": 3000,
"costCents": 12
"costCents": 12,
"billingType": "metered_api",
"occurredAt": "2026-11-24T10:00:00Z"
}
```
`occurredAt` is required. An agent can report only its own costs.
## Subscription Usage
Each cost event has a billing type. When an adapter runs on a provider subscription instead of an API key, it reports the billing type `subscription_included`. Paperclip keeps the token counts and records the cost as 0 cents.
Budgets count billed cents only. Subscription usage therefore never moves an agent toward its budget, and a budget does not stop an agent that runs on a subscription.
## Budget Awareness
Agents should check their budget at the start of each heartbeat:
@@ -87,7 +97,11 @@ GET /api/agents/me
# Check: spentMonthlyCents vs budgetMonthlyCents
```
If budget utilization is above 80%, focus on critical tasks only. At 100%, the agent is auto-paused.
The Paperclip skill tells agents to focus on critical tasks only when they are above 80% of their budget. This is guidance for the agent. The server does not send the agent a message at the warning threshold.
When spend reaches the budget, and the hard stop is on for that budget, the server pauses the agent, refuses new runs, and tells the running run to stop. A board user resolves the budget incident. See [Costs and Budgets](/guides/board-operator/costs-and-budgets).
`spentMonthlyCents` is the sum of the recorded cost of the agent's cost events. Subscription usage adds 0 cents to it.
## Best Practices
@@ -95,3 +109,4 @@ If budget utilization is above 80%, focus on critical tasks only. At 100%, the a
- Check budget early in the heartbeat to avoid wasted work
- Above 80% utilization, skip low-priority tasks
- If you're running out of budget mid-task, leave a comment and exit gracefully
- Company and project budgets can also stop an agent's work, even when its own budget has room
+196 -24
View File
@@ -1,70 +1,242 @@
---
title: Costs and Budgets
summary: Budget caps, cost tracking, and auto-pause enforcement
summary: Cost tracking, budget limits, hard stops, and budget incidents
---
Paperclip tracks every token spent by every agent and enforces budget limits to prevent runaway costs.
Paperclip records the usage and cost of every agent run. You can set a budget for the company, for one agent, or for one project. When the recorded spend reaches a budget, Paperclip stops work in that scope until you act.
<Warning>
A budget counts dollars only. Usage on a Claude, ChatGPT, or other provider subscription is recorded at $0, so **a budget does not stop an agent that runs on a subscription**. See [What a Budget Counts](#what-a-budget-counts).
</Warning>
## What a Budget Counts
A budget adds up the billed cost that Paperclip records, in cents. The API calls this metric `billed_cents`. It is the only budget metric. There is no budget for tokens or for the number of runs.
Every cost event has a billing type. The billing type decides whether the event has a dollar cost:
| Billing type | Recorded cost | Counts toward a budget |
|--------------|---------------|------------------------|
| `metered_api` | The cost the provider or Paperclip's price list reports | Yes |
| `subscription_included` | Always $0. Tokens are still recorded | No |
| `subscription_overage`, `credits`, `fixed` | The reported cost, if there is one | Yes, for the reported cost |
| `unknown` | The reported cost, if there is one | Yes, for the reported cost |
An agent runs on a subscription when its adapter signs in with a subscription account instead of an API key. For example, Claude Code reports subscription billing when it runs without `ANTHROPIC_API_KEY` and without Bedrock. Codex reports it when it runs without `OPENAI_API_KEY`.
For these agents:
- The spend stays at $0, so the warning and the hard stop never trigger.
- The budget card shows $0 observed, even when the agent uses many tokens.
- To stop the agent, pause it. See [Managing Agents](/guides/board-operator/managing-agents).
- To see how much of the subscription is used, open the **Providers** tab. See [Subscriptions and Provider Quota](#subscriptions-and-provider-quota).
## How Cost Tracking Works
Each agent heartbeat reports cost events with:
Each agent run reports cost events with:
- **Provider** — which LLM provider (Anthropic, OpenAI, etc.)
- **Biller** — who charges for the usage. This can differ from the provider
- **Billing type** — see the table above
- **Model** — which model was used
- **Input tokens** — tokens sent to the model
- **Output tokens** — tokens generated by the model
- **Input, cached input, and output tokens**
- **Cost in cents** — the dollar cost of the invocation
- **Cost status** — `reported`, `estimated`, or `unpriced`
These are aggregated per agent per month (UTC calendar month).
Cost reports use the current UTC calendar month unless you pick another period.
Paperclip cost accounting is not a provider invoice. Check the provider's own billing page for the amount you owe.
## Budget Scopes
You can set a budget on three scopes. A run must pass every budget that applies to it: the company budget, the budget of its agent, and the budget of its project.
| Scope | Window | Resets |
|-------|--------|--------|
| Company | UTC calendar month | On the first of each month (UTC) |
| Agent | UTC calendar month | On the first of each month (UTC) |
| Project | Lifetime, when you set it from the project page | Never. It counts all spend on the project |
The API accepts either window (`calendar_month_utc` or `lifetime`) for any scope. If you create a project budget through the API, send `"windowKind": "lifetime"`. If you leave the field out, the API uses `calendar_month_utc`.
## Budget Settings
The API calls a budget a budget policy. Each one has these settings:
| Setting | Default | Meaning |
|---------|---------|---------|
| `amount` | — | The limit in cents. `0` turns the budget off |
| `warnPercent` | `80` | The percent of the limit at which the warning opens. From 1 to 99 |
| `notifyEnabled` | `true` | Whether the warning opens |
| `hardStopEnabled` | `true` | Whether Paperclip stops work when spend reaches the limit |
| `reservationCents` | `0` | The reserve per run. See [Reserve per Run](#reserve-per-run) |
| `unpricedUsagePolicy` | `block` | What to do when usage has no reliable price. See [Usage With No Reliable Price](#usage-with-no-reliable-price) |
In the UI you can change the amount, the reserve per run, and the unpriced-usage setting. To change `warnPercent`, `hardStopEnabled`, or `notifyEnabled`, use the API.
## Setting Budgets
### Company Budget
Only board users can set or change a budget.
Set an overall monthly budget for the company:
### In the UI
- **All budgets** — select **Costs** in the sidebar, then open **Budgets**. The page lists each budget that exists and each open budget incident.
- **Agent budget** — open the agent's page and select **Budget**.
- **Project budget** — open the project's page and select the **Budget** tab.
The Budgets page shows a company budget only after one exists. If the company has no budget yet, you can create one with the API below.
### With the API
Set the monthly company budget:
```
PATCH /api/companies/{companyId}
PATCH /api/companies/{companyId}/budgets
{ "budgetMonthlyCents": 100000 }
```
### Per-Agent Budget
Set individual agent budgets from the agent configuration page or API:
Set the monthly budget of one agent:
```
PATCH /api/agents/{agentId}
PATCH /api/agents/{agentId}/budgets
{ "budgetMonthlyCents": 5000 }
```
Set any budget, including a project budget and the other settings:
```
POST /api/companies/{companyId}/budgets/policies
{
"scopeType": "project",
"scopeId": "{projectId}",
"windowKind": "lifetime",
"amount": 20000,
"warnPercent": 70
}
```
`scopeType` is `company`, `agent`, or `project`. For a company budget, `scopeId` is the company ID.
An amount of `0` turns the budget off and releases a pause that the budget caused.
The older calls still work. `PATCH /api/companies/{companyId}` and `PATCH /api/agents/{agentId}` with `budgetMonthlyCents` set the same monthly budget. On an agent, only a board user can change this field.
## Budget Enforcement
Paperclip enforces budgets automatically:
| Spend | What happens |
|-------|--------------|
| Reaches `warnPercent` of the limit (default 80%) | A budget warning opens. Work continues |
| Reaches the limit, with `hardStopEnabled` on (default) | A hard stop. Paperclip pauses the scope, refuses new work, and tells running work to stop |
| Threshold | Action |
|-----------|--------|
| 80% | Soft alert — agent is warned to focus on critical tasks only |
| 100% | Hard stop — agent is auto-paused, no more heartbeats |
### The Warning
An auto-paused agent can be resumed by increasing its budget or waiting for the next calendar month.
At the warning threshold, Paperclip opens a budget warning and records it in the activity log. The warning does not pause work and Paperclip does not send a message to the agent.
Agents that use the Paperclip skill are instructed to focus on critical tasks when they are above 80% of their budget. That is guidance in the skill text. The agent reads its own budget and decides. It does not follow the `warnPercent` setting.
You can dismiss the warning or raise the budget. The warning also closes when the spend falls below the threshold.
### The Hard Stop
When spend reaches the limit:
1. Paperclip pauses the scope with the pause reason `budget`. For a company budget, the company is paused. For an agent budget, the agent is paused. For a project budget, the project is paused.
2. New runs in that scope are refused.
3. Runs in progress are told to stop. A run can take a short time to stop, so the final spend can be above the limit.
4. A budget incident opens, together with a pending approval, and the activity log records it.
If `hardStopEnabled` is off, none of this happens. Spend can go above the limit and only the warning opens.
### Resolving a Hard Stop
Open the budget incident. It appears on the Budgets page and on the budget panel of the agent. The dashboard shows a notice with a link while an incident is open. The incident has two actions:
- **Raise budget & resume** — enter a new limit. The new limit must be more than the current spend. Paperclip removes the budget pause and continues the runs that the stop cancelled.
- **Keep paused** — dismiss the incident. The scope stays paused.
You can also raise the limit directly on the budget card or with the API. This has the same effect on the pause.
A paused scope also resumes when:
- **A new month starts**, for a monthly budget. The spend of the new month is $0, so Paperclip closes the incident and removes the budget pause. This also applies after you select **Keep paused**. A lifetime project budget never resets.
- **You turn the budget off** by setting the amount to `0`.
Paperclip removes only the pause that the budget caused. A manual pause stays. If more than one budget stopped the work, each one must be resolved.
To resolve an incident with the API:
```
POST /api/companies/{companyId}/budget-incidents/{incidentId}/resolve
{ "action": "raise_budget_and_resume", "amount": 150000 }
```
The other action is `"keep_paused"`. It needs no `amount`.
## Reserve per Run
The reserve per run is an estimate of what one run costs. Paperclip holds this amount against the budget before each run starts and releases it when the cost of the run is recorded.
If the recorded spend plus the amounts held for unfinished runs would go above the limit, the new run is refused. This keeps several runs that start together from all passing a budget that has room for only one.
- The default is `0`, which turns the estimate off.
- When more than one budget applies to a run, Paperclip uses the largest reserve.
- The reserve is an estimate. The real cost of a run can be higher.
Set it under **Advanced settings** on the budget card, or with `reservationCents` in the API.
## Usage With No Reliable Price
Sometimes Paperclip records usage but cannot give it a price. `unpricedUsagePolicy` controls what a budget with a hard stop does in that case:
- `block` (default) — a hard stop opens, even when the known spend is under the limit. To resume, resolve the unpriced usage or change the setting to `allow`. You cannot raise the budget past this stop.
- `allow` — the budget ignores the unpriced usage and counts known spend only.
Subscription usage is not unpriced usage. It has a price of $0 and never triggers this setting.
In the UI, this is the **Block new work when usage has no reliable price** checkbox under **Advanced settings**. To see which runs have no price, expand **run costs unavailable** on the Costs overview. See [Cost Reporting](/guides/agent-developer/cost-reporting).
## Subscriptions and Provider Quota
Budgets do not cover subscriptions. Paperclip shows subscription information in two other places.
### Subscriptions
On the Costs page, the **Subscriptions** card lists the subscription accounts that your agents use and their monthly fee. Select **View details** to see each account. You can enter or correct the price of an account you manage, and link two entries that are the same paid subscription.
The fee is the full cost of the account, including use outside Paperclip. It is separate from recorded charges and from budgets. Ending tracking here does not cancel the subscription at the provider.
### Provider Quota Windows
On the Costs page, the **Providers** tab shows the quota windows that a subscription provider reports, such as a 5-hour and a 7-day window. Each window shows the percent used and when it resets.
Connect a subscription account under AI connections to see its quota. Quota windows are separate from budgets. A budget does not read them.
## Viewing Costs
### Dashboard
The dashboard shows current month spend vs budget for the company and each agent.
The dashboard shows the spend of the current month against the monthly company budget. While a budget incident is open, it also shows a notice with the number of open incidents and the number of agents and projects that a budget paused.
### Costs Page
Select **Costs** in the sidebar. The page shows spend for the period you select, with breakdowns by agent, project, provider, and biller.
### Cost Breakdown API
```
GET /api/companies/{companyId}/costs/summary # Company total
GET /api/companies/{companyId}/costs/by-agent # Per-agent breakdown
GET /api/companies/{companyId}/costs/by-project # Per-project breakdown
GET /api/companies/{companyId}/costs/summary # Company total
GET /api/companies/{companyId}/costs/by-agent # Per-agent breakdown
GET /api/companies/{companyId}/costs/by-project # Per-project breakdown
GET /api/companies/{companyId}/budgets/overview # Budgets, spend, and open incidents
```
See the [Costs API](/api/costs) for the full list.
## Best Practices
- Check how each agent is billed before you rely on a budget. A budget protects API-key usage. It does not limit a subscription
- Set conservative budgets initially and increase as you see results
- Monitor the dashboard regularly for unexpected cost spikes
- Use per-agent budgets to limit exposure from any single agent
- Use a project budget to cap the total cost of one piece of work
- Monitor the dashboard regularly for unexpected cost spikes
- Critical agents (CEO, CTO) may need higher budgets than ICs
@@ -45,10 +45,14 @@ Each agent gets their own adapter config, role, and budget. The org tree enforce
## Step 5: Set Budgets
Set monthly budgets at both the company and per-agent level. Paperclip enforces:
Set monthly budgets at the company and per-agent level. You can also set a budget on a project. By default Paperclip enforces:
- **Soft alert** at 80% utilization
- **Hard stop** at 100% — agents are auto-paused
- **Warning** at 80% of the budget. Work continues
- **Hard stop** at 100% — the company, agent, or project is paused, new work is refused, and a budget incident opens
Both thresholds are settings on the budget.
Budgets count dollars only. Usage on a provider subscription is recorded at $0, so a budget does not stop an agent that runs on a subscription. See [Costs and Budgets](/guides/board-operator/costs-and-budgets).
## Step 6: Launch
+4 -3
View File
@@ -12,7 +12,8 @@ The dashboard displays:
- **Agent status** — how many agents are active, idle, running, or in error state
- **Task breakdown** — counts by status (todo, in progress, blocked, done)
- **Stale tasks** — tasks that have been in progress for too long without updates
- **Cost summary** — current month spend vs budget, burn rate
- **Cost summary** — current month spend against the monthly company budget
- **Budget incidents** — a notice while a budget warning or hard stop is open
- **Recent activity** — latest mutations across the company
## Using the Dashboard
@@ -22,7 +23,7 @@ Access the dashboard from the left sidebar after selecting a company. It refresh
### Key Metrics to Watch
- **Blocked tasks** — these need your attention. Read the comments to understand what's blocking progress and take action (reassign, unblock, or approve).
- **Budget utilization** — agents auto-pause at 100% budget. If you see an agent approaching 80%, consider whether to increase their budget or reprioritize their work.
- **Budget utilization** — by default a budget opens a warning at 80% and stops work at 100%. When a budget incident is open, raise the budget or keep the scope paused. Budgets count dollars only, so subscription usage does not appear here. See [Costs and Budgets](/guides/board-operator/costs-and-budgets).
- **Stale work** — tasks in progress with no recent comments may indicate a stuck agent. Check the agent's run history for errors.
## Dashboard API
@@ -33,4 +34,4 @@ The dashboard data is also available via the API:
GET /api/companies/{companyId}/dashboard
```
Returns agent counts by status, task counts by status, cost summaries, and stale task alerts.
Returns agent counts by status, task counts by status, cost summaries, budget incident and pause counts, and stale task alerts.
@@ -13,7 +13,7 @@ Agents are the employees of your autonomous company. As the board operator, you
| `idle` | Active but no current heartbeat running |
| `running` | Currently executing a heartbeat |
| `error` | Last heartbeat failed |
| `paused` | Manually paused or budget-paused |
| `paused` | Manually paused, or paused by a budget hard stop |
| `terminated` | Permanently deactivated (irreversible) |
## Creating Agents
@@ -70,7 +70,7 @@ Edit an agent's configuration from the agent detail page:
- **Adapter config** — change model, prompt template, working directory, environment variables
- **Heartbeat settings** — interval, cooldown, max concurrent runs, wake triggers
- **Budget** — monthly spend limit
- **Budget** — monthly spend limit. It counts billed cost, so it does not limit an agent that runs on a subscription
Use the "Test Environment" button to validate that the agent's adapter config is correct before running.
@@ -88,7 +88,9 @@ Resume to restart:
POST /api/agents/{agentId}/resume
```
Agents are also auto-paused when they hit 100% of their monthly budget.
An agent is also paused when its recorded spend reaches its monthly budget, unless the hard stop is turned off for that budget. A budget pause opens a budget incident. Resolve it from the incident: raise the budget, or keep the agent paused. A budget pause on a monthly budget also ends when the next UTC month starts.
Budgets count dollars only. Usage on a provider subscription is recorded at $0, so a budget does not pause an agent that runs on a subscription. See [Costs and Budgets](/guides/board-operator/costs-and-budgets).
## Terminating Agents
+2 -2
View File
@@ -12,7 +12,7 @@ An organization is the top-level unit in Paperclip. Each organization has:
- A **goal** — the reason it exists (e.g. "Build the #1 AI note-taking app at $1M MRR")
- **Employees** — every employee is an AI agent
- **Org structure** — who reports to whom
- **Budget** — monthly spend limits in cents
- **Budget** — monthly spend limits in cents. Projects can have a budget too
- **Task hierarchy** — all work traces back to the company goal
One Paperclip instance can run multiple companies.
@@ -24,7 +24,7 @@ Every employee is an AI agent. Each agent has:
- **Adapter type + config** — how the agent runs (Claude Code, Codex, shell process, HTTP webhook)
- **Role and reporting** — title, who they report to, who reports to them
- **Capabilities** — a short description of what the agent does
- **Budget** — per-agent monthly spend limit
- **Budget** — per-agent monthly spend limit. It counts billed cost, so it does not limit usage on a provider subscription
- **Status** — active, idle, running, error, paused, or terminated
Agents are organized in a strict tree hierarchy. Every agent reports to exactly one manager (except the CEO). This chain of command is used for escalation and delegation.