ADR-0066: A provider's price, not the harness, costs a model no vendor bills
Status: accepted | Date: 2026-10-22
References: RFC-0001:C-INFERENCE, RFC-0002:C-PLAYBOOK-BUDGET, ADR-0065
Context
A run's cost ceiling (RFC-0002:C-PLAYBOOK-BUDGET) counts what each agent turn cost. The engine took that number from the harness: Claude Code's result cost or its OTEL roll-up, falling back to the engine's own vendor table only when the harness reported nothing. The vendor table already priced a model from neither the Anthropic nor the OpenAI family at nothing, since such a model is self-hosted and nobody bills for it.
Through a custom provider (ADR-0065) the Claude harness runs models that are not Claude, such as GLM and DeepSeek on a self-hosted endpoint. Claude Code prices those tokens at a Claude rate, so its number won over the table. One run reported $418 against a $50 ceiling and another hit its ceiling in ten minutes, on a model nobody bills for.
An operator who wants such runs bounded by a budget still needs a cost for them, real or notional.
Decision
A provider registration may carry a price: USD per million tokens for input, output, cache-read, and cache-write tokens. The controller stores it with the provider and renders it into the agent binding of the inference document. A decision binding never carries one.
The engine resolves one pricing per run from the agent binding and the model:
- A priced binding. Each turn costs its token counts times the price, for any model, and the harness's cost is ignored.
- No price, a vendor-billed model (an Anthropic or OpenAI name). The harness's cost stays authoritative, and the vendor table estimates a turn that reported none.
- No price, any other model. The turn costs nothing, and the harness's cost is ignored.
Every engine site that costs a turn (the local and sandboxed turn ends, the live activity readout, and the provisional budget line) settles through that one pricing.
Consequences
- A self-hosted model no longer trips a cost ceiling on the harness's Claude-rate guess. Without a price its runs spend nothing, so only the wall-clock ceiling bounds them.
- An operator can budget a self-hosted model at a real or notional rate by pricing its provider, and every run on it is costed the same way whichever harness runs it.
- A priced run's cost is only as complete as the harness's token counts. A harness that reports cost but no tokens costs nothing under a price.
- The price rides the inference document as an additive field (contract 1.19.0). An engine older than 1.19.0 rejects a document that carries one as an unknown field, so a priced provider needs dispatch images at 1.19.0 or later. Unpriced providers render the document unchanged.
- Scope and grounded-rank turns do not take their model from the agent binding, so they never take its price either. They are costed by the vendor table rule.
Alternatives Considered
Price a model no vendor bills at nothing by default, and let a provider carry a price that overrides the harness for any model (accepted)
- Pros: The default matches what the vendor table already intended and what is actually billed., An operator who wants a budget to bite on a self-hosted model can have one., One pricing per run, so every cost site agrees.
- Cons: Unpriced self-hosted runs are bounded by time alone., Older engines refuse a priced document.
Keep the harness's reported cost authoritative and only fix the default (rejected)
- Cons: The harness's number for a non-vendor model is a guess at a rate nobody charges, so it would keep overriding the table.
Extend the engine's vendor table with self-hosted model names and rates (rejected)
- Cons: The rate depends on who hosts the model, not on its name, so the engine cannot know it., Every new model needs an engine release.