cost-tracker

cost-tracker is a skill for Claude Code, Codex from chandrudp29/skillhub. It costs 40 tokens per session (1,141 once invoked), scanned A, original, MIT.

A guide for tracking, estimating, and comparing the cost of using language-model APIs from different providers.

In plain words
What is it for?
Estimate costs for users or requests, compare providers for a workload, and find ways to reduce language-model API costs.
Why use it?
It helps prevent unexpected bills and shows how usage levels, models, and providers affect spending.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument; mentions Codex.

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/chandrudp29/skillhub/cost-tracker
Any agent
npx skills add chandrudp29/skillhub --skill cost-tracker
Clone the repo
git clone --depth 1 https://github.com/chandrudp29/skillhub

Made for: Claude Code, Codex.

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 cost-tracker

README.md
[![agentmods](https://agentmods.dev/badge/skills/chandrudp29/skillhub/cost-tracker.svg)](https://agentmods.dev/skills/chandrudp29/skillhub/cost-tracker)
Your own site
<a href="https://agentmods.dev/skills/chandrudp29/skillhub/cost-tracker"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/cost-tracker.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,141 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.1 $0.00040 $0.01141
Opus 5 $0.00020 $0.00571
Sonnet 5 $0.00008 $0.00228
Haiku 4.5 $0.00004 $0.00114

Measured 6d ago against content hash f7ae5c6bceef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

cost-tracker 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 6d 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.

skills/cost-tracker/SKILL.md · 123 lines

How it starts

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

Cost Tracker

Helps you understand, estimate, and reduce LLM API costs before they become a surprise bill.

When to Use

  • "How much is this going to cost at scale?"
  • "Our LLM bill is too high — help me reduce it"
  • "Compare cost of GPT-4o vs Claude vs Gemini for my workload"
  • "Estimate cost for N users / N requests per day"
  • Before building any LLM feature that will run in production

Current Pricing Reference (verify at provider — prices change)

Model Input ($/1M tokens) Output ($/1M tokens)
GPT-4o $2.50 $10.00
GPT-4o mini $0.15 $0.60
Claude Sonnet 4 $3.00 $15.00
Claude Haiku 4 $0.80 $4.00
Gemini 1.5 Pro $1.25 $5.00
Gemini 1.5 Flash $0.075 $0.30
Llama 3.1 70B (Bedrock) $0.72 $0.72

Always verify on the provider pricing page before using for decisions.

Cost Estimation Workflow

Step 1 — Measure actual token usage

For a representative sample of real requests, count:

  • Average input tokens (system prompt + context + user message)
  • Average output tokens
  • Request volume per day/month

Tools:

  • OpenAI: response.usage.total_tokens
  • Anthropic: response.usage.input_tokens / output_tokens
  • Most providers return usage in the response object

Step 2 — Calculate baseline cost

daily_cost = (avg_input_tokens * input_price + avg_output_tokens * output_price) 
             * requests_per_day / 1_000_000

monthly_cost = daily_cost * 30

Example: 1000 req/day, avg 2000 input + 500 output tokens, GPT-4o:

= (2000 * $2.50 + 500 * $10.00) * 1000 / 1,000,000
= ($5.00 + $5.00) * 1000 / 1,000,000
= $10,000 / 1,000,000 = $0.01/req
= $10/day = $300/month

Step 3 — Identify the biggest cost drivers

In most LLM applications, costs come from:

  1. System prompt length — injected on every request, often 2000+ tokens
  2. Context window stuffing — passing entire docs or chat history
  3. Over-powered model — using GPT-4 for tasks GPT-4o mini handles fine
  4. Long outputs — asking for verbose responses when brief would do

Read the full file on GitHub · 123 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 123 lines · 40 tokens per session scan A f7ae5c6bceef

Subscribe to this mod's changes

cost-tracker is a skill published in the GitHub repository chandrudp29/skillhub (13 stars, last pushed 2mo ago), licensed MIT. It adds 40 tokens to every session and 1,141 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

tinker-training-cost

Calculates training costs for Tinker fine-tuning jobs. Use when estimating costs for Tinker LLM training, counting tokens in datasets, or comparing Tinker model training prices. Tokenizes datasets using the correct model tokenizer and provides accurate cost estimates.

synthetic-sciences/openscience · 55 tokens

lynkr

Universal LLM gateway with intelligent routing, Graphify code intelligence, Distill compression, routing telemetry, Code Mode, and 12+ provider support. 60-80% cost reduction for Claude Code, Cursor, and Codex.

Fast-Editor/Lynkr · 50 tokens

finops-expert

Expert-level cloud financial operations, cost optimization, and cloud economics. Use when the user mentions cloud cost, optimization, cloud economics, or AWS cost, or when the task involves FinOps Fundamentals, Cost Management, FinOps Practices, or Cost Visibility.

personamanagmentlayer/pcl · 55 tokens

data-cost-optimization

Use this skill when asked about data cost optimization, Snowflake cost management, BigQuery slot management, S3 storage tiering, warehouse cost optimization, FinOps for data, cloud data cost reduction, or query cost analysis. This skill enforces: Snowflake credit usage analysis with query optimization, BigQuery slot…

j4flmao/agent-skills · 138 tokens

finance-skills

Auditable public-company fundamentals screening for AI coding agents. Use when the user invokes /finance-skills or requests a deterministic fundamentals, valuation, risk, health, comparison, screening, or sector-framework report. Provides engine-computed numbers, provenance, an answerdraft, and explicit data gaps.…

notEhEnG/finance-skills · 111 tokens

cost-optimization-background-llm

Reduce LLM token spend on cron + background + kanban-worker without touching interactive (CLI/ACP/Discord) paths. Inventory → classify → apply config/scheduler/worker patches → verify with hard evidence.

humanerd-drew/opencode-drewgent · 50 tokens