COMPUTE_BUDGET_EXCEEDED
Inference cost exceeded budget
What happened
The estimated cost of the inference call exceeded the configured budget cap. The estimate uses ~chars/4 tokens × per-token rate.
How to fix
Either raise the budget, shorten the prompt, or lower maxOutputTokens. Always estimate first with Compute.estimate(...).
Example
const est = await compute.estimate({ messages, maxOutputTokens: 256 });
if (est.fee > budget) throw new Error("too expensive");
Reference
- Namespace:
COMPUTE - Help URL:
https://0gkit.com/errors/COMPUTE_BUDGET_EXCEEDED - See also: all error codes