Recurse docs / 12

Agent costs and limits

Recurse charges account credit for active requests. Charges cover model calls and secure execution. Deployments have no idle charge or subscription. See Pricing for current rates.

You set the spending and time allowance. Your coding agent tracks use across development runs, proposes work that fits the remaining allowance, and stops before starting work that does not. Adding credit or approving a larger allowance remains your decision.

Keep these controls separate:

ControlWhat it governs
Your allowanceThe total time and money authorized for the design effort.
Account balanceThe credit currently available to the account.
CPU and memory ceilingsThe resources available to one serverless run.
Task inputs such as max_trialsSearch behavior inside the Recurse agent.

Only your allowance expresses how much work you authorize. Account balance and platform limits do not grant the coding agent permission to spend up to those amounts.

Set an allowance for the whole effort

A development effort can include baseline runs, revised runs, repeated evaluations, and a deployment check. Tell your coding agent how much you are willing to spend and how long it may continue experimenting across all of them.

Start with a small representative comparison to estimate cost and duration. Before each additional batch, ask the coding agent to report:

  • The allowance already used and the amount remaining.
  • The runs it proposes to start, including any concurrent work.
  • The hypothesis each run will test.
  • The estimated cost and the evidence the batch should produce.

Treat cost as unknown until it has been measured. A shared wallet change is not a reliable per-run estimate while other work is active.

Concurrency can reduce elapsed time, but every active run can spend the same account credit. Preparation and model calls can temporarily hold funds; run execution does not reserve a maximum-duration amount. Count all active runs when deciding whether another batch fits. Work that depends on an earlier result should remain sequential.

A task value such as max_trials limits the Recurse agent's search. It is not a platform spending cap or permission to spend. The CLI does not provide a per-run dollar-cap flag.

Review balance and purchases yourself

Check the account:

Shell
recurse billing balance

Balance is the total wallet balance. Available excludes temporary preparation and model-call holds. Active run execution spends from the account balance without a separate maximum-duration hold. If the account cannot fund active work, Recurse requests cancellation of its active funded runs and reports account_balance_exhausted after provider confirmation. Use the available amount and the cost of all active work when deciding what to authorize.

Adding credit is a separate purchase decision:

Shell
recurse billing top-up 5

Supported amounts range from $5 to $500 with at most two decimal places. --no-open prints the hosted-checkout URL without opening a browser, but still creates a checkout session. A URL does not mean payment completed.

If you have a Recurse-issued credit code:

Shell
recurse billing redeem CODE

An insufficient-balance error does not authorize a coding agent to purchase credit, redeem a code, or increase the allowance.

Choose resources and a model

Your coding agent proposes resource ceilings based on tool requirements and reports the expected cost and elapsed-time effect of changing them.

OptionDefaultSupported values
--cpu10.125–16, in increments of 0.125.
--memory-mib1024512–16384 MiB, in increments of 128 MiB.

For example:

Shell
recurse run ./my-agent --inputs inputs.json --cpu 2 --memory-mib 2048

These are billable ceilings, not measurements of actual utilization or total spending controls. Deployment settings become defaults for its calls.

Direct runs are preemptible by default. recurse run --non-preemptible avoids provider Function preemption, but cannot prevent other failures. Its 3× premium applies to Function CPU and memory only, not the whole bill; model tokens, Sandbox use, and preparation keep their normal rates. The option does not apply to MCP deployments.

The coding agent selects a model through agent.model in agent.yaml; there is no CLI model override. Omitting the field currently selects gpt-5.6-luna. Compare quality and cost on representative cases before approving a different model.

Account for platform limits

LimitImplication
Earlier of available account funding and the fixed provider limitA run can continue while the account funds it, up to 24 hours per provider attempt with three minutes reserved for finalization. It does not restart automatically at that boundary. Packaging and preparation take additional time.
Artifacts retained for 24 hoursDownload evidence you need to keep.
Source archive: 64 MiB compressed and expanded, at most 1,024 membersInclude required runtime files and exclude development outputs.
Secret value: at most 32 KiB of non-empty UTF-8Store credentials through secret commands rather than packaging them.

When the allowance is exhausted, the coding agent should not start another run. Ask it to report the best feasible result, active or uncertain runs, measured gains, and remaining hypotheses. Preserve that record before deciding whether to stop or authorize a new allowance.