JuliusBrussee/caveman · error · Error
cave_provider_usage_unpriced
Error message
cave_provider_usage_unpriced
What it means
Thrown by validateProviderUsage (packages/agent/src/execution-kernel.ts:162): the (provider, model) pair is not present in the generated pricing catalog and options.requirePriced is true. Budgeted runs must fail closed when the catalog cannot price a model — an unpriced model may not silently consume $0 of budget.
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 27d5a3981a)
Solutions
- Use a model that the current catalog prices (check the generated catalog for exact ids).
- Update the catalog source (public/shared/provider-catalog/catalog/current.yaml) and re-run scripts/generate-agent-catalog.mjs so the new model is priced, then rebuild.
- Remove the typo/alias and pass the exact catalog model id.
Example fix
# before
agent({ model: "anthropic/claude-sonnet-4-6-alias" }); # not in catalog, budgeted run
# after
agent({ model: "anthropic/claude-sonnet-4-5" }); # exact catalog id Defensive patterns
Strategy: validation
Validate before calling
import { catalogCost } from "@caveman-ai/agent";
const probe = catalogCost({ provider, model, inputTokens: 1, outputTokens: 1, cacheReadTokens: 0, cacheWriteTokens: 0, reasoningTokens: 0 });
if (!probe.priced) throw new Error(`model '${provider}/${model}' has no catalog price; pick a cataloged model or update the catalog`); Prevention
- Restrict budgeted (requirePriced) runs to models present in the generated catalog.
- Regenerate the catalog (scripts/generate-agent-catalog.mjs) after catalog updates and rebuild.
- Validate model ids against catalog keys at configuration load time.
When it happens
Trigger: Running with requirePriced: true (budget/token-metered reserved runs do this) using a model that has no global row in the generated catalog — e.g. a brand-new model, a regional-only catalog row, a private/finetuned deployment id, or a typo'd model string.
Common situations: Provider ships a new model before the catalog is regenerated; model id spelling differs from the catalog key; using an alias or gateway-rewritten id that is not a catalog entry; regional-only pricing rows deliberately omitted from the region-agnostic catalog.
Related errors
- cave_budget_denomination_unavailable
- ${label}: ${key} has no pricing block
- ${label}: duplicate region-agnostic row ${key}
- ${label}: no priced region-agnostic rows found
- %s: provider, model, and region are required
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/5c677f7a514b0ff0.
Report an issue: GitHub.