Skip to content
SBDocs

Customers · Guides

Cap your spend

Every limit on what runs may cost: the team balance, a key's monthly cap, the per-step ceiling, a project's hard cap and draft runs.

Before you start
  • A Sushibelt team you are an owner or admin of.
You'll end with
Keys and a team that cannot spend more than you decided, and code that knows which limit it met.

Code that starts runs can spend your team's credits without anyone watching. These limits decide how much. Each one refuses a run before it spends, with 402 and a body that says which limit it hit.

The limits at a glance#

Spend limits
LimitDescription
Team balanceAlways onA run starts only if your balance can cover its hold. Answers 402 with required.
Monthly cap on a keyPer API keyOnce a key has spent its cap this month, it cannot start runs. Answers 402 with monthlyCreditCap.
Per-step credit ceilingPer teamNo single step may cost more. Answers 402 with ceiling, or fails the step before it runs.
Project hard capPer projectA run that would take the project past its cap does not start. Answers 402 with hardCap.
Draft runsPer runA cheaper pass for trying a workflow out. Pass "mode": "draft".
ScopesPer API keyA key without the runs:create scope cannot start runs at all.

Team balance#

Before a run starts, Sushibelt holds enough credits to cover it. If your balance is too low, the run does not start, and required says how many credits the hold needs. The hold can be a little higher than estimatedCredits: it covers the most the run can cost, and what it does not use is released when the run ends.

402 Insufficient creditsJSON
{ "error": "Insufficient credits", "required": 12 }

Buy credits in the app under Team settings → Balance, then start the run again.

Monthly cap on an API key#

Give each key the most it may spend in a month, and a leaked or runaway key cannot spend more. Set the cap when you create the key: Team settings → API keys, the Monthly cap field, in credits.

  • What counts. The credits charged for runs the key started this calendar month, less any refunds. Months run in Copenhagen time, and the count starts again on the 1st.
  • When it is checked. When a run starts. A key that has not yet reached its cap may start a run, and that run may take it past the cap; the next one is refused.
  • What it refuses. Only starting runs. A key over its cap can still list workflows and read runs.
  • Runs continued in the app. If someone continues a key's failed run in the app, what it charges still counts against that key.
  • Changing it. On the API keys page, choose Edit on the key. The same panel sets when the key expires and which workflows it may run. The next run is checked against the new cap.
402 Monthly credit cap reachedJSON
{
  "error": "Monthly credit cap reached",
  "monthlyCreditCap": 500,
  "spentThisMonth": 500,
  "resets": "on the 1st of next month"
}

If Sushibelt cannot check a key's spend at the moment you start a run, it refuses the run rather than let it through unmetered: 503 with Retry-After: 30. Wait that long and try again.

Per-step credit ceiling#

The ceiling is the most any single step may cost, for every run in your team — from the canvas, from the API, from any key. It stops one expensive step, such as a model priced by the second, from costing more than you expect.

  1. In the app, open Team settings. Under Billing, choose Cost overview.
  2. In Per-step credit ceiling, type the most one step may cost, in credits, and choose Save. Clear limit removes it.

Only a team owner can change it. It is enforced twice:

  • Before the run starts. If Sushibelt can tell that a step will cost more than the ceiling, the run is refused with 402, naming the step's node type, its charge and the ceiling. Nothing is charged.
  • Before each step. If a step's cost only becomes clear as the run goes, the step is refused before it is sent to the provider, and the run fails. The steps before it are charged as usual.

For a text model, the ceiling also shortens the longest answer the step may give, so that the answer fits it.

402 Per-step ceilingJSON
{
  "error": "A step in this workflow (DiffusionWorker) could cost more than this team's per-step credit limit",
  "nodeType": "DiffusionWorker",
  "estimatedCharge": 40,
  "ceiling": 25
}

Project hard cap#

A project can have a hard cap: the most it may spend in its budget period. A run that would take the project's spend past the cap, counting the run's estimate, does not start.

  1. In the app, open the project. The Spending cap card is in the side panel, under Usage.
  2. Set Hard cap in whole credits, and Resets to daily, weekly or monthly. A Soft cap only turns the bar amber; runs carry on. Leave a cap empty for none.

Only a team owner can change the caps; anyone who can see billing sees them.

402 Project hard cap exceededJSON
{
  "error": "Project hard cap exceeded",
  "hardCap": 5000,
  "spent": 4990,
  "estimate": 12
}

Draft runs#

Pass "mode": "draft" while you are trying a workflow out. Each model makes one variation with fewer sampling steps, and text models give short answers, so models priced by time or by use cost less. A model priced per run costs the same.

Start a draft run
WORKFLOW_ID="YOUR_WORKFLOW_ID"

curl -X POST "https://app.sushibelt.ai/api/v1/workflows/$WORKFLOW_ID/runs" \
  -H "Authorization: Bearer $SUSHIBELT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "draft"
  }'

A key that cannot spend#

A key without the runs:create scope cannot start runs, so it cannot spend. Give dashboards, reports and anything that only reads runs a key with workflows:read and runs:read alone.

Tip: one key per job

Give each service, pipeline or agent its own key with its own cap. The API keys page shows when each key was last used, and revoking one stops only that job.

Next steps