Inference costs

Foundry records token usage and a cost estimate on agent_session_ended. foundry campaign report <name> shows the known list estimate for each stage. JSON reports include unpriced models and pricing limitations. These figures are USD at published API list prices. Subscription fees and negotiated discounts require separate accounting.

Rates verified on 2026-10-04

The first six rows are the models configured on mojility-ops-01 at verification. The remaining rows cover Foundry's built-in defaults and earlier configured models. Prices are USD per million tokens, for standard processing.

ModelFresh inputCache readCache write (5m)Cache write (1h)Output
claude-fable-5-1100.2512.502050
claude-opus-5-540.205820
claude-sonnet-5-520.202.50410
gpt-6-astra10112.5012.5050
gpt-6.1-sol20.102.502.5010
gpt-6-luna0.100.010.1250.1250.50
claude-opus-5 / opus-4-8 / opus-4-7 / opus-4-6 / opus-4-550.506.251025
claude-fable-510112.502050
claude-sonnet-520.202.50410
claude-sonnet-4-6 / sonnet-4-530.303.75615
claude-haiku-4-5 (-20251001)10.101.2525
gpt-5.550.500030
gpt-5.42.500.250015
gpt-5.4-mini0.750.075004.50
gpt-6-sol20.202.502.5010

Sources: Fable 5.1, Opus 5.5, Sonnet 5.5, Anthropic pricing, OpenAI pricing, GPT-5.5, GPT-5.4, and GPT-5.4 Mini.

OpenCode uses IDs such as openai/gpt-5.4. Lookup accepts that prefix, the anthropic/ prefix, dated snapshots and bracketed context suffixes. An exact entry takes precedence over its normalised base model.

Billing rules

Claude 4.6 and later have no long-context premium. Cache-write retention affects Claude's price; the transcript's aggregate TTL split apportions writes across models. Fable 5.1 and Opus 5.5 have lower cache-read rates than earlier models. Anthropic's batch discount is 50%. Opus 5.5 fast mode doubles rates; inference geography can add 10%. The provider's reported cost takes precedence over Foundry's list calculation. Anthropic pricing

GPT-6 requests above 272,000 input tokens double fresh input, cache reads and cache writes, and multiply output by 1.5. Fast processing doubles the applicable rates. Batch and Flex halve standard rates. Regional processing can add 10%. These modifiers apply to individual requests, so a multi-million-token session does not by itself prove that long-context pricing applied. GPT-6.1 Sol, GPT-6 Astra, GPT-6 Luna

GPT-5.4 and GPT-5.5 also have a 272,000-input-token threshold with 2x input and 1.5x output pricing. Their model pages describe the premium as applying to the full session. Mini has no such premium documented on its model page. GPT-5.4, GPT-5.5

OpenAI cache writes use their own rate instead of the fresh-input rate. Foundry subtracts reported cache reads and writes from total input before pricing each category. Reasoning tokens are already included in output and are never added again. Cache retention does not change the GPT-6 write rate. OpenAI prompt caching

Measurement limits

Current Codex terminal summaries can report cache_write_input_tokens, including an explicit zero. Older summaries omit it. Foundry keeps that distinction and marks missing writes as a pricing limitation for models that charge for them. The retained terminal record is used once; earlier records are not added again.

Terminal summaries do not report individual request sizes, processing tier or regional premiums. Foundry uses standard short-context rates and records those limitations. Such a list estimate has basis: partially_priced. The campaign report prints the limitations and labels the figure partial. It does not apply a long-context multiplier to cumulative session input. Server-side tool fees are outside this token estimate unless included in a provider-reported cost.

A Claude provider-reported cost remains authoritative even if the list book lacks a model. unpriced_models still exposes the incomplete list comparison. Interrupted sessions without terminal usage remain unmeasured. An unknown model is never treated as proof of free inference. OpenCode transcripts still have no supported terminal-usage parser and remain unmeasured.

Runtime price book

~/.foundry/token-rates.json is editable without a rebuild. Each rate records its source URL and verification date. until is inclusive; then applies on the following day. Missing models are added from the seed at daemon startup and in memory when pricing a session.

The 2026-10-04 seed also refreshes entries that exactly match the 2026-08-04 seed, including prices, provenance and dating fields. Other entries survive. Sonnet 5 retains Foundry's historical $3/$15 accounting through 2026-08-31 and uses the vendor's current $2/$10 standard price from 2026-09-01. Existing recorded events are not rewritten.