Budgets and limits
Cap what reviews cost: the monthly account budget, repository caps, the per-pull-request limit, and the Spend & budget tab.
On this page›
Defaults
| Limit | Default | Scope | Counts |
|---|---|---|---|
| Monthly budget | $25 | Your account, all repositories, per calendar month (UTC) | Own-key spend: review rounds, chat replies, disputes and /ask questions |
| Repository cap | None | One repository, per calendar month (UTC) | The same spend, on that repository |
| Per pull request | $5 | One pull request, across all its rounds | Review calls only |
Each can be raised, lowered or switched off. Calls on a ChatGPT plan count toward none; calls on CodePanel credits, where offered, are bounded by your credit balance instead (Billing and credits).
How the limits work
Once a limit is reached, a new round is refused before any model is called. The monthly budget and a repository cap also stop new chat replies; a cap keeps one busy repository from using the whole budget. Months start at midnight UTC. The per-PR limit counts every billed review call in the cost ledger, including calls whose output could not be used.
Before calling a model, a round holds an estimate of its own-key cost, so concurrent rounds cannot all start against the same headroom. Holds count across your account and last at most 12 minutes, the review lease. A round is refused once recorded spend plus running holds reaches the cap or budget, never on its own estimate, so the last round admitted can overshoot by at most its own cost.
Set the limits
| Limit | Where |
|---|---|
| Monthly budget | Settings → Budget (/settings?tab=budget): an amount in USD, blank for the $25 default, or No monthly budget, then Save budget. A bad value fails with "Enter a positive dollar amount, or leave it blank." |
| Repository cap | The repository's Spend & budget tab → Limits → Monthly cap for this repository; blank for no cap |
| Per pull request | The same Limits section (Per pull request, blank for no limit), Spending limit on Default reviewers (/panel), or an agent (below) |
Changing the per-PR limit on a repository's tab gives that repository its own copy of your default reviewers, so later changes to your defaults no longer reach it.
The per-PR limit belongs to a panel and needs the panel:write scope:
update_panel { "panelId": "...", "budgetUsd": 2.5 } # null turns it off
codepanel panel set --budget 2.50 # --budget none turns it off
curl -sS -X POST -H "Authorization: Bearer $CODEPANEL_TOKEN" \
-H "content-type: application/json" \
-d '{"panelId":"...","budgetUsd":2.5}' \
"$CODEPANEL_URL/api/v1/panels/update"
The monthly budget and repository caps can also be read with read and set with budget:write. No other scope includes budget:write, so an agent that only reviews and rates cannot raise what it may spend unless you give it that scope too. A tool that asks for it when it signs in (codepanel login, an MCP connector) gets it only if you tick it on the approval page yourself:
get_budget { "repo": "owner/name" }
set_budget { "monthlyUsd": 50 } # "default" for $25, null for none
set_budget { "repo": "owner/name", "capUsd": 20 } # null removes the cap
codepanel budget owner/name
codepanel budget set --monthly 50 # --monthly default | none
codepanel budget set --repo owner/name --cap 20 # --cap none removes it
curl -sS -X POST -H "Authorization: Bearer $CODEPANEL_TOKEN" \
-H "content-type: application/json" \
-d '{"repo":"owner/name","capUsd":20}' \
"$CODEPANEL_URL/api/v1/budget"
Every change answers with the limits before and after it, including what is left this month and the refusal the next round would get (GET /budget). Set it back the same way. Nothing here changes CodePanel credits.
Refusals
A round refused by a spending limit is reported at the top of CodePanel's review comment, so a waiting agent knows no review is coming:
> Review of `abc1234` skipped: Spending limit of $5.00 reached for this pull request ($5.12 spent); review skipped.
- The previous review stays below the notice. With no CodePanel comment yet, one is posted with only the notice.
- A later refusal replaces the notice (the same commit and reason leave it unchanged), and the next review that runs removes it.
- Spending-limit, subscription and credits refusals (
plan_required,plan_limit,credits_required,credits_exhausted, Billing) are posted; other failures, such as a missing key, show in the dashboard. - The review is marked
failedand the merge gate judges the commit on the findings it already has, with reviews paused: an agent's answers count as given, and only a finding nobody answered (or an upheld dispute) fails it.
| Limit | Reason after skipped: |
|---|---|
| Per pull request | "Spending limit of $5.00 reached for this pull request ($5.12 spent); review skipped." With unpriced models, "plus N call(s) to unpriced models" follows the amount. |
| Monthly budget | "Your account's monthly budget of $325.00 has been reached ($325.10 spent this month across your repositories). Change or remove it in CodePanel → Settings → Budget, or with POST /api/v1/budget (monthlyUsd)." At the default: "Your account's default monthly budget of $25.00 has been reached". |
| Repository cap | "The monthly cap of $100.00 for owner/repo has been reached ($100.20 spent this month). Change or remove it in CodePanel → Repository → Spend & budget, or with POST /api/v1/budget (repo, capUsd)." |
While rounds are running, the monthly messages add "plus $X held for reviews in progress" inside the parentheses.
Too many repositories to count
An account with more repositories or running rounds than its budget can count is refused with "Your account has too many repositories or reviews in progress for its monthly budget to count, so new rounds are refused. Remove the account budget in CodePanel → Settings → Budget and set caps on repositories instead."
Accounts from before the account budget
A repository that had its own monthly amount keeps it as its cap. The account budget becomes the sum of the active repositories' old limits, counting each unset one at $25; if any active repository had no limit, the account has no budget.
Unpriced models
A model CodePanel cannot price runs, but counts as $0 toward every limit, so recorded spend is a floor. Default reviewers names it under Spending limit, and the API marks the member priced: false. See Models and cost.
Spend & budget tab
| Section | Shows |
|---|---|
| This month | The repository's spend including chat, a bar for This repository's cap and one for Account budget, all repositories, each with Change. When one is reached: "This repository's cap is reached." or "Your account budget is reached.", then "New reviews on your own keys and chat replies won't start here until next month, or until you raise or remove it. Reviews on CodePanel credits still run." |
| Limits | The repository cap and per-PR limit, editable |
| By model | This month's calls by model and role (reviewer, orchestrator, chat) with each one's share |
| Last 30 days | Spend per day |
| By pull request | This month's top 20, most expensive first |
The monthly total is exact for priced calls. Breakdowns use the latest 500 rounds and up to 500 billed calls per pull request, so on a busy repository By model adds a Not itemized line to reach the total. A total marked ≥ is a lower bound, and the tab says why ("Some reviews used a model CodePanel has no price for. Those calls count as $0, so the real total is higher." or "Some older billed calls are not counted here yet, so the real total may be higher.").
The home page shows Spend this month against the budget, and lists a budget or cap that is spent under Needs you; the Pull requests list shows each pull request's cost.
Keep costs down
- Economy models for whole-diff reviewers; one frontier Security reviewer at most (cost tiers).
- Fewer reviewers: each is one call per round.
- Lower effort where a role does not need it.
- Short repo context: it is on every call.
- A limit on automatic rounds per pull request (Triggering reviews).
Explain and optimize spend from an agent
codepanel spend owner/repo --json returns the UTC month's recorded model
cost by role, provider and model, with own-key cost, credits, failed calls,
unpriced calls and itemization coverage. Subscription fees are separate.
The read-only MCP equivalent is get_spend (GET /api/v1/spend?repo=owner/repo).
Its account adds the whole account: the last 30 UTC days split into
credits and own keys, pull requests merged and spend per merged pull
request, the share of prompt tokens read from a provider's cache and what
that saved, and the month by model with its projection.
An incomplete breakdown is explicitly marked; wait for historical itemization
before drawing conclusions about which model dominates.
codepanel optimize owner/repo --json reads that spend, verified quality and
balanced and economy panel alternatives together, with provider configuration issues. It changes no settings.
The MCP equivalent is get_optimization. The dashboard's Spend & budget tab
shows the same spend suggestions and lets you preview, apply and undo a
repository-specific panel change.
It also offers a copyable Markdown prompt for an agent in your checkout.
The same handoff is markdownPrompt in the optimization tool's JSON output,
and is printed by the CLI. It asks the agent to inspect source and review
history, preserve critical coverage, validate changes and retain an undo.
Panel alternatives are secondary, expandable estimates rather than a
recommendation to replace your custom panel automatically.
The authorship report (also GET /api/v1/authorship?repo=owner/repo) covers
the latest 100 rounds, with unknown-author counts and same-author-family
panels. A missing marker does not prove human authorship. Declare the actual
agent and model in plain-text Authoring agent: / Authoring model: lines
in the PR description; these take precedence over inherited commit markers
and remain explicitly self-reported. Different providers do not necessarily
mean different model families, especially on hosting services.
Recommendations compare the current and suggested panels on the same token
profile and include observed orchestrator calls per round. They use recent
usage and general eval evidence, not a source-code audit or guaranteed savings.
Use codepanel panel apply --repo owner/repo --cost low --quality medium
only after inspecting that evidence; save its JSON undo object to restore.
Explicit authorship can also be sent through submit_handoff with authorAgent,
authorModel (only when known), and a full 40-character head sha. The CLI
equivalents are --author-agent and --author-model. These labels are separate
from the submitting agent, apply only to that exact commit, and are read even
when handoff prompts are disabled. Current-head API author labels take precedence over PR-description declarations.