- Engineering
- 5 min read
Spending blocked by default: what is not configured does not go through

AI Gateway + prepaid + Compute planner
On this page
Every platform that resells cloud capacity has to answer the same question: what happens when a setting is missing? At AIUBY, the answer for money is always the same. What is not configured blocks, it never lets things through. This post shows where that rule shows up along the path of a model call and in the Compute planner, and where it has exceptions.
#The rule
There are two ways to treat a missing value. In the first, a null budget means "no limit", and the bill shows up at the end of the month. In the second, a null budget means "nobody has decided yet", and the call does not go out. We chose the second, and we pay its price: a new organization gets errors until someone tops up and sets the values. We prefer that friction to a charge nobody authorized.
In the Gateway, the decision happens before any contact with the provider. A model outside the workspace's list, without a budget or without a registered price never reaches the provider.
#A workspace without a budget refuses
Each workspace has a monthly budget. If the row does not exist, the Gateway does not treat it as unlimited: it refuses with 403 budget_not_configured. If it exists and has run out, the response is 429 budget_exceeded. Zero is a valid value, and zero blocks.
That is why the budget screen does not let you remove a budget, only change its value: without the row, the Gateway would deny anyway, and an empty field would only confuse whoever looks at it.
#Prepaid: no balance, no call
AI usage is prepaid in BRL, topped up via Pix. A new organization starts with a zero balance, and until there is a top-up every call that uses AI gets this response, with HTTP status 402:
{
"error": {
"code": "insufficient_credit",
"message": "...",
"request_id": "..."
}
}There is no after-the-fact billing. When the balance runs out, the calls stop. The BRL amount of each call is recorded by the database at the moment it closes, with upward rounding, and does not change afterward. The credit statement is append-only: an entry is never altered later.
| Situation | API response |
|---|---|
| Workspace without a defined budget | 403 budget_not_configured |
| Prepaid balance at zero | 402 insufficient_credit |
| Workspace or rule budget exhausted | 429 budget_exceeded |
| Organization monthly cap reached | 429 org_budget_exceeded |
Balance and budget are independent limits. With no balance, the response is 402 even if budget remains.
#Reserving in-flight calls
Checking the balance before calling the provider is not enough. Twenty concurrent requests would see the same balance, all would pass, and together they would exceed the limit. The Gateway solves this with a reservation:
- The decision is serialized per workspace and then per organization, always in that order. It completes before the provider is called.
- The approved call is recorded as pending, with the maximum cost reserved: the estimated input plus the requested
max_tokens. Withoutmax_tokens, the reservation assumes 4,096 output tokens. - If the route has a fallback model, the most expensive candidate counts: the alternative may cost more than the first.
- The available balance is the credit minus what has already been charged and minus what is reserved. If it does not cover the new call's reservation, the response is
402. - A reservation from a process that crashed stops counting after 15 minutes.
The workspace budget and the organization cap use the same math: closed spending for the month plus in-flight reservations. A test in the suite fires concurrent calls against a small balance and checks that it never goes negative.
Limit
#The cap for catalog sign-ups
When the owner adds the first product from the catalog, the organization starts with the prepaid account at a zero balance, an AI usage cap of US$100 per month across all workspaces, and a US$100 budget in each workspace. Nobody needs to remember to configure it: the initial state is already the closed one.
The cap is not a plan or an amount charged. With prepaid, the balance is what limits spending. The cap is the second lock, for the case of a large top-up and a forgotten call loop. The owner can lower the cap and split the budget across workspaces in Settings; above US$100, it goes through the team. Details are in Budget and allowed models.
#The same principle in Compute
In AIUBY Compute the resource is different (a running container, not tokens), but the rule is the same, and it is written into the product's architecture decision: a missing setting never turns into unlimited spending. The deployment planner is a pure function. It takes the requested configuration and what is known (catalog, verified quotas, rate card, budget) and returns a list of blockers. It only deploys when the list is empty.
- Quota not verified in the cloud account:
quota_unverified. Missing means not verified, not available. - Hardware without a price in the current rate card:
no_rate_card. - Workspace without a Compute budget, or with a zero budget:
no_budget. - For a paid CPU deployment: an account that is not prepaid, a balance below the minimum, and a workspace monthly cap that is null or exhausted are three separate blockers.
- With the runtime's master switch off, nothing can be deployed.
The plan can be checked beforehand, without creating anything, and it shows the blockers. The step-by-step guide is in Your first application on AIUBY Compute.
#Limits
- The balance rule applies to organizations with a billing account. Organizations served by the team under a custom usage agreement do not have a BRL billing account: they rely only on the workspace budget, which is still mandatory.
- The organization cap is an extra layer. It is created automatically for catalog sign-ups; in other organizations, it only exists if the team sets it.
- Pay-per-use, billed to a credit card, is not available yet. Today prepaid is the only option.
- There is no automatic top-up: a top-up is always a Pix generated by the owner on screen.
- In Compute, GPU is billed per minute the instance is running, idle or not, and not by time in use like CPU.
The list of error codes is in Errors, and the balance rules in Billing.


