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

  1. Upgrade the library to a version whose cost catalog includes the model
  2. Drop requirePriced (or set it false) if pricing is optional for this call
  3. Check the model string for typos and use the exact catalog name
  4. 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

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


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)