pricing

pricing is an agent for coding agents from the-teacher/active_harness. It costs 0 tokens per session (856 once invoked), scanned A, original, MIT.

A cost record attached to each result from an AI model call. It reports input, output, and total usage costs in US dollars when token and pricing data are available.

In plain words
What is it for?
Use it to inspect the cost of individual AI calls and separate input costs from output costs.
Why use it?
It removes the need to calculate model spending separately and shows when a cost cannot be determined.

Agent

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 agents/the-teacher/active_harness/pricing
Clone the repo
git clone --depth 1 https://github.com/the-teacher/active_harness

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pricing

README.md
[![agentmods](https://agentmods.dev/badge/agents/the-teacher/active_harness/pricing.svg)](https://agentmods.dev/agents/the-teacher/active_harness/pricing)
Your own site
<a href="https://agentmods.dev/agents/the-teacher/active_harness/pricing"><img src="https://agentmods.dev/badge/agents/the-teacher/active_harness/pricing.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 856 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.00000 $0.00856
Opus 5 $0.00000 $0.00428
Sonnet 5 $0.00000 $0.00171
Haiku 4.5 $0.00000 $0.00086

Measured 3d ago against content hash f4ae3c0ef4f9, 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.

docs/agents/pricing.md · 87 lines

How it starts

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

Cost Calculation

ActiveHarness automatically calculates the monetary cost of every LLM call and attaches it to the Result object.

Cost is computed from token usage and per-model pricing data bundled with the gem (sourced from models.dev).


Reading Cost from a Result

agent = SupportAgent.call(input: "What is your return policy?")
result = agent.result

if result.usage.cost
  puts result.usage.cost.input   # => 0.00003
  puts result.usage.cost.output  # => 0.00024
  puts result.usage.cost.total   # => 0.00027
else
  puts "Cost unavailable for this model"
end

All values are in USD, rounded to 8 decimal places.

result.usage.cost is nil when:

  • The model is not found in the pricing registry.
  • The provider did not return usage data (some free-tier models, streaming without usage header).
  • Pricing data is missing an input or output price for the model.

Pricing Registry

Pricing data is provided by the separate active_harness_pricing gem (a runtime dependency of ActiveHarness, require "active_harness_pricing" — not code that lives in this repo). It fetches model data from models.dev and caches it to {project_root}/tmp/active_harness/models_dev_pricing.json. The cache (and the in-memory copy) is considered fresh for 72 hours; once stale, the next lookup triggers a background refetch automatically.

Force a refresh manually:

ActiveHarness::Pricing.preload!   # re-fetches from models.dev; network failures are silently ignored

There is no public ActiveHarness::Pricing.update — that method only exists on the internal ActiveHarness::Pricing::ModelsDev source (ActiveHarness::Pricing::ModelsDev.update), which raises on failure instead of swallowing it.

Look up a model:

m = ActiveHarness::Pricing.find("mistralai/mistral-nemo")
puts m.input_per_million    # => 0.15   (USD per 1M input tokens)
puts m.output_per_million   # => 0.15   (USD per 1M output tokens)

Read the full file on GitHub · 87 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 · 87 lines · 0 tokens per session scan A f4ae3c0ef4f9

Subscribe to this mod's changes

pricing is an agent published in the GitHub repository the-teacher/active_harness (89 stars, last pushed 24d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 856 tokens. 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.