
Cost Verification Auditor
- 111 installs
- 178 repo stars
- Updated July 14, 2026
- erichowens/some_claude_skills
Audit and verify API costs, token usage, and billing accuracy for agent systems.
About
Cost Verification Auditor validates billing and token usage accuracy. Ensure correct pricing application and detect billing anomalies.
- Cost auditing and verification.
- Token usage validation.
Cost Verification Auditor by the numbers
- 111 all-time installs (skills.sh)
- Ranked #549 of 1,039 Cloud & Infrastructure skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/erichowens/some_claude_skills --skill cost-verification-auditorAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 111 |
|---|---|
| repo stars | ★ 178 |
| Last updated | July 14, 2026 |
| Repository | erichowens/some_claude_skills ↗ |
What it does
Audit and verify API costs, token usage, and billing accuracy for agent systems.
Files
Cost Verification Auditor
Verify that token cost estimates are within ±20% of actual Claude API usage.
When to Use
✅ Use for:
- Validating token estimation systems after implementation
- Pre-deployment cost accuracy checks
- Debugging unexpected API bills
- Periodic estimation drift detection
❌ NOT for:
- Looking up model pricing (use pricing docs)
- Budget planning or forecasting
- Cost optimization strategies
- Comparing models by price
Core Audit Process
Decision Tree
Has estimator? ──No──→ Build estimator first (see Calibration Guidelines)
│
Yes
↓
Define 3+ test cases (simple/medium/complex)
↓
Estimate BEFORE execution (no peeking!)
↓
Execute against real API
↓
Calculate variance: (actual - estimated) / estimated
↓
Variance ≤ ±20%? ──Yes──→ PASS ✓
│
No
↓
Apply fixes from Anti-Patterns section
↓
Re-run verificationVariance Formula
const inputVariance = (actual.inputTokens - estimate.inputTokens) / estimate.inputTokens;
const outputVariance = (actual.outputTokens - estimate.outputTokens) / estimate.outputTokens;
const costVariance = (actual.totalCost - estimate.totalCost) / estimate.totalCost;
// PASS if both input AND output within ±20%
const passed = Math.abs(inputVariance) <= 0.20 && Math.abs(outputVariance) <= 0.20;Common Anti-Patterns
Anti-Pattern: The 500-Token Overhead Myth
Novice thinking: "Claude Code adds ~500 tokens overhead, so add that to every estimate."
Reality: Direct API calls have ~10 token overhead. The 500+ overhead is ONLY when using Claude Code's full context (system prompts, tools, conversation history).
Timeline:
- Pre-2025: Many tutorials used 500+ token estimates
- 2025+: Direct API overhead is minimal (~10 tokens)
What to use instead:
| Context | Overhead |
|---|---|
| Direct API call | ~10 tokens |
| With system prompt | 50-200 tokens |
| With tools/functions | 100-500 tokens |
| Claude Code full context | 500-2000 tokens |
How to detect: Consistent 40-90% overestimation = overhead too high.
---
Anti-Pattern: Per-Node Accuracy Obsession
Novice thinking: "Every node must be within ±20% or the estimator is broken."
Reality: LLM output length is non-deterministic. Per-node output variance of 30-50% is normal. What matters is aggregate cost accuracy.
What to use instead:
- Focus on total DAG cost variance (should be ±20%)
- Accept per-node output variance up to ±40%
- Use constrained prompts ("list exactly 3") to reduce variance
How to detect: Input estimates accurate, output varies wildly = normal LLM behavior.
---
Anti-Pattern: Peeking Before Estimating
Novice thinking: "Let me run the API call first to see what tokens we get, then build the estimator."
Reality: This produces perfectly-fitted estimates that fail on new prompts. Estimation must happen BEFORE execution.
Correct approach: 1. Estimate based on prompt length and heuristics 2. Execute API call 3. Compare variance 4. Adjust heuristics if needed
Calibration Guidelines
Input Token Estimation
// Calibrated 2026-01-30
const inputTokens = Math.ceil(prompt.length / CHARS_PER_TOKEN) + OVERHEAD;| Text Type | CHARS_PER_TOKEN | Notes |
|---|---|---|
| English prose | 4.0 | Most consistent |
| Code | 3.0-3.5 | Symbols tokenize differently |
| Mixed | 3.5 | Balanced (recommended default) |
| JSON/structured | 3.0 | Punctuation heavy |
Output Token Estimation
| Prompt Constraint | Multiplier | Notes |
|---|---|---|
| "List exactly N items" | 0.8x input | Highly constrained |
| "Brief summary" | 1.0x input | Moderate |
| "Explain in detail" | 2-3x input | Expansive |
| Unconstrained | 1.5x input | Variable |
Always: Minimum 100 output tokens for any meaningful response.
Model Behavior
| Model | Output Tendency |
|---|---|
| Claude Opus | Longer, more detailed |
| Claude Sonnet | Balanced |
| Claude Haiku | Concise, efficient |
Quick Fixes
| Symptom | Cause | Fix |
|---|---|---|
| Overestimating by 40%+ | Overhead too high | Reduce from 500 → 10 |
| Underestimating inputs | Chars/token too high | Reduce from 4.0 → 3.5 |
| Output wildly varies | LLM non-determinism | Use constrained prompts |
| Total cost accurate but per-node off | Normal aggregation | Accept it, focus on totals |
Verification Checklist
- [ ] 3+ test cases (simple, medium, complex)
- [ ] Estimates run BEFORE API calls
- [ ] Variance formula:
(actual - estimated) / estimated - [ ] Target: ±20% for input AND output
- [ ] Report includes actionable recommendations
References
See /references/calibration-data.md for detailed calibration tables and historical data.
Calibration Data
Historical calibration data from actual API verification tests.
Calibration Run: 2026-01-30
Model: claude-haiku-4-5-20251001 Target Accuracy: ±20% Result: PASS (8.6% total cost variance)
Test Results
| DAG | Complexity | Est. Input | Actual Input | Variance | Est. Output | Actual Output | Variance | Est. Cost | Actual Cost | Variance |
|---|---|---|---|---|---|---|---|---|---|---|
| Simple Research | simple | 102 | 112 | +9.8% | 123 | 184 | +49.6% | $0.000717 | $0.001032 | +43.9% |
| Medium Pipeline | medium | 233 | 198 | -15.0% | 310 | 346 | +11.6% | $0.001783 | $0.001928 | +8.1% |
| Complex Fan-Out | complex | 468 | 281 | -40.0% | 798 | 607 | -23.9% | $0.003340 | $0.003316 | -0.7% |
| TOTAL | - | 803 | 591 | -26.4% | 1231 | 1137 | -7.6% | $0.0058 | $0.0063 | +8.6% |
Key Findings
1. Input estimation: Overestimated by 26% on average 2. Output estimation: Underestimated by 8% on average 3. Total cost: Within target at 8.6% variance 4. Per-node variance: Higher than aggregate (expected due to LLM non-determinism)
Calibration Parameters Used
const CHARS_PER_TOKEN = 3.5; // Balanced for mixed text/code
const OVERHEAD_TOKENS = 10; // Direct API call, no system prompt
const OUTPUT_MULTIPLIER = 1.2; // With 100 token minimumPrompt Characteristics
| DAG | Total Chars | Nodes | Avg Chars/Node |
|---|---|---|---|
| Simple | 340 | 1 | 340 |
| Medium | 755 | 3 | 252 |
| Complex | 990 | 6 | 165 |
Recommendations from This Run
- Input estimation is acceptable (within 20% aggregate)
- Output estimation benefits from constrained prompts
- Focus on total cost accuracy, not per-node accuracy
- Consider increasing output multiplier for unconstrained prompts
Historical Trends
| Date | Model | Overhead Used | Chars/Token | Total Variance | Status |
|---|---|---|---|---|---|
| 2026-01-30 | claude-haiku-4-5 | 10 | 3.5 | +8.6% | PASS |
| (baseline) | - | 500 | 4.0 | +40-90% | FAIL |
Model Pricing (2026-01)
| Model | Input $/M | Output $/M | Recommended For |
|---|---|---|---|
| claude-opus-4-5 | $15.00 | $75.00 | Complex reasoning |
| claude-sonnet-4 | $3.00 | $15.00 | Balanced tasks |
| claude-haiku-4-5 | $1.00 | $5.00 | Cost-effective testing |
| claude-3-5-haiku | $0.80 | $4.00 | Legacy |
Next Calibration
Schedule quarterly recalibration to detect drift:
- [ ] 2026-Q2: Re-run with updated prompts
- [ ] 2026-Q3: Check against new model releases
- [ ] 2026-Q4: Annual review