pricing

A development guide for maintaining the model price data used by Splitrail, an application that tracks AI coding costs. It covers flat and tiered rates, caching, aliases, and prices that change over time.

In plain words
What is it for?
Use it when adding an AI model, changing its input or output costs, recording cache pricing, adding model aliases, or marking estimated prices.
Why use it?
It explains where pricing belongs and how to represent different provider pricing rules without miscounting usage.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/piebald-ai/splitrail/pricing
Any agent
npx skills add Piebald-AI/splitrail --skill pricing
Clone the repo
git clone --depth 1 https://github.com/Piebald-AI/splitrail

Made for: Claude Code, Codex.

Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 715 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.00715
Opus 5 $0.00012 $0.00358
Sonnet 5 $0.00005 $0.00143
Haiku 4.5 $0.00002 $0.00072

Measured 3d ago against content hash d058d17660ee, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pricing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/pricing/SKILL.md · 46 lines

How it starts

The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pricing Model Updates

Token pricing is defined in src/models.rs. Built-in models are populated by populate_defaults() into the runtime model registry, and user/config models can be merged with init_external_models().

Adding a New Model

  1. Add a ModelInfo entry in populate_defaults() with:
    • pricing: Use PricingStructure::Flat { input_per_1m, output_per_1m } for flat-rate models, or PricingStructure::Tiered for threshold-based pricing.
    • caching: Use the appropriate CachingSupport variant (None, OpenAI, Anthropic, OpenAIWithWrites, or Tiered).
    • service_tiers: Leave empty unless the provider has distinct priority/flex/batch rates.
    • dated_pricing: Leave empty unless pricing changes by usage date.
    • is_estimated: Set to true only when pricing is not confirmed by a provider/tool source.
    • input_token_semantics: Auto-derived for built-in models (defaults to ExcludesCache); only GPT/o-series models typically need IncludesCacheRead. External model configs should set this explicitly if it affects cache-read counting.
  2. If the model has aliases (date suffixes, provider-prefixed names, regional names, etc.), add entries to the alias section mapping each observed name to the canonical model name.
  3. Add or update tests in src/models.rs for canonical pricing, aliases, caching, and estimated/non-estimated status.

Dated Pricing Overrides

Use dated_pricing when a model has temporary promotional pricing, launch pricing, or another time-bounded rate that should apply based on the original usage timestamp.

The default pricing and caching fields should represent the durable/current sticker price. Each DatedPricing override has a valid_until: NaiveDate exclusive end date and applies when usage_date < valid_until. For example, an introductory rate that applies through 2026-08-31 should use valid_until = NaiveDate::from_ymd_opt(2026, 9, 1).expect("valid date").

When adding a dated override:

Read the full file on GitHub · 46 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 46 lines · 24 tokens per session scan A d058d17660ee

Subscribe to this mod's changes

pricing is a skill published in the GitHub repository Piebald-AI/splitrail (218 stars, last pushed 12d ago), licensed MIT. It adds 24 tokens to every session and 715 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.