Every tool result in a KISS Sorcar task ends with a line like
Budget: $12.48/$1000.00. That number is computed by a four-stage pipeline,
and this audit walked all four stages end to end:
calculate_cost prices them per million tokens.Prices were checked against the primary pricing pages of OpenAI (developers.openai.com, incl. four per-model pages), Anthropic (platform.claude.com), Google (ai.google.dev), DeepSeek (api-docs.deepseek.com), Moonshot (platform.kimi.ai — overview, K3, K2.7-Code, K2.6, K2.5), xAI (docs.x.ai), and OpenRouter (kimi-k3 and kimi-k2.5 listings) — ten pages across seven provider sites.
The token accounting itself is sound. No double-billing paths were found:
prompt_tokens before billing; reasoning tokens ride inside
completion_tokens and are priced as output — matching how OpenAI bills.input_tokens, cache reads, and 5-minute/1-hour cache
creation counts are disjoint and billed at 1× / 0.1× / 1.25× / 2× — exactly the published multipliers.prompt_token_count,
thinking tokens are billed as output, and server-side tool-use prompt tokens as input,
all per the UsageMetadata reference.| Model (KISS entry) | KISS in/out $/M | Published | Verdict |
|---|---|---|---|
| claude-fable-5 | 10 / 50 | $10 / $50 · cache $1 / $12.50 / $20 | correct |
| claude-opus-4-8 · -4-7 · -4-6 · -4-5 | 5 / 25 | $5 / $25 | correct |
| claude-sonnet-5 | 2 / 10 | $2 / $10 intro (→ $3/$15 on Sep 1, 2026) | correct today |
| gpt-5.6-sol / -terra / -luna | 5/30 · 2.5/15 · 1/6 | same, + cache-write 1.25× + long tier | correct |
| gpt-5.5 / gpt-5.4 (+mini, nano) | 5/30 · 2.5/15 … | same, free cache writes | correct |
| gemini-3.1-pro-preview | 2 / 12 | $2/$12, >200k $4/$18, cache 0.1× | correct |
| gemini-3.5-flash · 2.5-pro · flash tiers | 1.5/9 · 1.25/10 … | same | correct |
| deepseek-v4-pro / v4-flash (OpenRouter) | 0.435/0.87 · 0.098/0.196 | hit ratios 0.003625/0.435 and 0.02 | correct |
| grok-4.5 (openrouter/x-ai) | 2 / 6 | $2 / $6 | correct |
platform.kimi.ai's July-2026 price sheets no longer match what shipped in
MODEL_INFO.json, and Kimi K3 (launched Jul 16) was missing entirely,
which made any kimi-k3 run die with a KISSError: unknown model.
| Model | Was (in/out $/M) | Actual (hit / miss / out) | Now |
|---|---|---|---|
| kimi-k2.5 | 0.60 / 2.50 | 0.10 / 0.60 / 3.00 | 0.60 / 3.00, hit 0.10 |
| kimi-k2.6 | 0.60 / 2.50 | 0.16 / 0.95 / 4.00 | 0.95 / 4.00, hit 0.16 |
| kimi-k2.7-code | 0.60 / 2.50 | 0.19 / 0.95 / 4.00 | 0.95 / 4.00, hit 0.19 |
| kimi-k3 | missing | 0.30 / 3.00 / 15.00 | added, 1M ctx |
OpenAI's model pages state, verbatim: “Prompts with >272K input tokens are priced at 2x input and 1.5x output for the full request.” The code switched gpt-5.4 / 5.5 / 5.6 to double rates at 200,000 tokens — and it counted output tokens toward the threshold too. Both errors overcharge. Example: a gpt-5.6-sol call with a 250k-token prompt and 100k output was billed $7.00 instead of $4.25 (+65%).
Fix: the tier now keys off prompt-side tokens only (fresh input + cache reads + cache writes), with the OpenAI threshold at 272,000 and Gemini's at its documented 200,000 (“$2.00, prompts ≤ 200k tokens”). Boundary covered by tests at 272,000 vs 272,001.
openrouter/moonshotai/* models fall under a blanket “cache read = 25% of
input” rule. For kimi-k3, OpenRouter lists cache reads at $0.30/M (10% of the $3 input
price); the rule was charging $0.75/M. Fixed with an explicit per-entry price — explicit
JSON values always beat prefix heuristics.
The adversarial reviewer (gpt-5.6-sol) probed the patched registry and found that adding
explicit cache-read prices made the pricing-defaults pass skip those entries
entirely, leaving their cache-write price None — which
calculate_cost conservatively bills at the full input rate. A million
cache-write tokens on kimi-k2.5 suddenly cost $0.60 instead of the correct $0.00 (Moonshot
has no cache-write fee). Fixed by writing explicit cache_write_price_per_1M: 0.0
into all five entries, with a test asserting the billed cost is exactly zero.
The code comment cited “K2.5: $0.15 hit vs $0.60 miss.” Current sheets show per-family ratios of 0.10×–0.20× (K2.5 $0.10, K2.6 $0.16, K2.7-Code $0.19, K3 $0.30). Comment rewritten; the 0.25× multiplier survives only as a conservative fallback for entries with no explicit value (e.g. legacy moonshot-v1).
Per the task brief, all code changes were made by claude-fable-5, and the
resulting diff plus the draft of this report were handed to gpt-5.6-sol for a
strictly read-only cross-examination (it modified no files; its spend was ~$2 of a $200
review allowance — about 1%). Its findings, all incorporated:
calculate_cost directly rather than trusting the tests.(x or 0.0) == 0.0 silently passes when
x is None; the assertion now demands exactly 0.0 plus a
zero-dollar billing probe.calculate_cost only prices tokens. KISS's own tooling runs client-side, so
exposure is minimal, but tasks that enable provider-side search will under-count.usage.cost field reports the actual charge per response — adopting it would
make gateway billing exact. Recorded as a future improvement.inference_geo:"us" option (1.1× on everything) is not modeled
because KISS uses global routing.Files changed: src/kiss/core/models/MODEL_INFO.json
(Kimi prices, kimi-k3, explicit cache read/write), src/kiss/core/models/model_info.py
(272k OpenAI threshold, prompt-side tier decision, comment fix),
src/kiss/tests/core/models/test_cost_accuracy_2026.py (updated + 8 new regression tests).
Evidence: the cost-accuracy suite and every other pricing test pass
(219 tests across the five cost-touching files; 920+ in the full models suite), and
uv run check (lint + mypy over 927 files) is green.
KISS Sorcar cost audit · July 20, 2026 · Sources: developers.openai.com, platform.claude.com, ai.google.dev, api-docs.deepseek.com, platform.kimi.ai, docs.x.ai, openrouter.ai. Development model: claude-fable-5 · adversarial reviewer: gpt-5.6-sol.