JuliusBrussee/caveman · error
cave_provider_usage_unpriced
cave_provider_usage_unpriced
Error message
cave_provider_usage_unpriced
What it means
validateProviderUsage throws cave_provider_usage_unpriced when the cost catalog has no price entry for the evidence's provider/model and options.requirePriced === true. The kernel refuses to accept usage it cannot price when pricing is mandatory.
Solutions
- Upgrade the library to a version whose cost catalog includes the model
- Drop requirePriced (or set it false) if pricing is optional for this call
- Check the model string for typos and use the exact catalog name
- Register/patch the pricing entry for custom models if the API allows it
Example fix
// before
kernel.usage(evidence, { requirePriced: true }); // model not in catalog
// after
kernel.usage(evidence, { requirePriced: false }); // or update to a cataloged model Defensive patterns
Strategy: validation
Validate before calling
if (requirePriced && !catalogHas(provider, model)) throw new Error("model not priced; adjust before calling"); Type guard
null
Try / catch
try { kernel.usage(evidence, { requirePriced: true }); } catch (err) { if (err.message === "cave_provider_usage_unpriced") { logger.warn("unpriced model", evidence.model); return { ...evidence, priced: false }; } throw err; } Prevention
- Keep the cost catalog current with library upgrades
- Validate model ids against the catalog at config load time
- Only set requirePriced:true when pricing is a hard requirement
- Watch changelogs for newly cataloged models
When it happens
Trigger: Calling priced()/usage()/validateExecution() with requirePriced:true for a model absent from catalogCost's price table (new/unreleased model, custom fine-tune, typo'd model id).
Common situations: Using a freshly released model before the library's cost catalog is updated; local/self-hosted models with no pricing entry; misspelled model identifiers like 'gpt4o'.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- cave_provider_cost_mismatch
- cave_budget_denomination_unavailable
- cave_provider_model_identity_mismatch
- cave_subagent_unpriced_budget
- : pricing.batch_discount_fraction must be <= 1
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/5c677f7a514b0ff0.
Report an issue: GitHub.
Appendix: source
Thrown at packages/agent/src/execution-kernel.ts:162
];
const disjointTotal = evidence.inputTokens + evidence.outputTokens +
evidence.cacheReadTokens + evidence.cacheWriteTokens;
if (values.some((value) => !Number.isSafeInteger(value) || value < 0) ||
evidence.totalTokens <= 0 || evidence.totalTokens !== disjointTotal ||
evidence.reasoningTokens > evidence.outputTokens) {
throw new Error("cave_provider_usage_incomplete");
}
const priced = catalogCost({
provider: evidence.provider,
model: evidence.model,
inputTokens: evidence.inputTokens,
outputTokens: evidence.outputTokens,
cacheReadTokens: evidence.cacheReadTokens,
cacheWriteTokens: evidence.cacheWriteTokens,
reasoningTokens: evidence.reasoningTokens,
});
if (!priced.priced && options.requirePriced === true) {
throw new Error("cave_provider_usage_unpriced");
}
if (options.reportedCostUsd !== undefined &&
(!priced.priced || !Number.isFinite(options.reportedCostUsd) ||
options.reportedCostUsd < 0 ||
Math.abs(options.reportedCostUsd - priced.usd) > 1e-12)) {
throw new Error("cave_provider_cost_mismatch");
}
return Object.freeze({
...evidence,
priced: priced.priced,
catalogCostUsd: priced.priced ? priced.usd : 0,
});
}
View on GitHub (pinned to 3ee70a1026)