cost-intel
AI spending tracker with cost-quality correlation.
A standalone Python CLI that tracks AI spending at the task level, optionally correlates it with quality scores, and produces cost-efficiency metrics.
Value prop: No unified cost-quality metric in a CLI-native package.
Install
pip install cost-intel
Quick Start
# Record a cost run
cost-intel record --model "openai/gpt-4o" --input-tokens 150 --output-tokens 80 --label "summarize-doc"
# Show cost report for the last 7 days
cost-intel report --last 7d
# Show cost per quality point (CPQP) with percentile ratings
cost-intel cpqp --last 30d
# Refresh model pricing from OpenRouter
cost-intel refresh-pricing
# Set a monthly budget
cost-intel budget set --monthly 500
# Check budget status
cost-intel budget status
Features
- Cost tracking — Record AI runs with token counts, compute costs from live pricing
- Quality correlation — Import quality scores, compute CPQP (cost-per-quality-point) with A/B/C/D/F percentile ratings
- Waste detection — Identify expensive low-quality runs
- Model comparison — Compare models by efficiency delta
- Budget alerts — Slack + SMTP alerts when spending exceeds thresholds
- CI/CD gates — Fail builds when CPQP exceeds a threshold
- OTel traces — Ingest OpenTelemetry spans, get trace-level cost breakdowns
- Prompt optimization — Analyze high-cost patterns and get trimming suggestions
- Budget enforcement — Hard-stop guard that blocks when budget is exceeded
Commands
cost-intel record Record a cost run
cost-intel report Cost summary report
cost-intel trends Daily spending or CPQP trends
cost-intel export Export to CSV
cost-intel budget set Set a budget
cost-intel budget status Check budget status
cost-intel refresh-pricing Fetch latest pricing from OpenRouter
cost-intel pricing set/show Manual pricing override
cost-intel estimate Estimate tokens/cost before a call
cost-intel ingest-api-responses Ingest JSONL API responses
cost-intel cpqp CPQP report with percentile ratings
cost-intel waste Waste analysis + waste index
cost-intel compare-models Compare models by efficiency
cost-intel optimize Model routing + target CPQP suggestions
cost-intel import-scores Import quality scores (CSV, Eval Harness, Braintrust)
cost-intel gate CI/CD cost gate (exit 0/1)
cost-intel alert check Run budget alerts
cost-intel alert test Show configured alert channels
cost-intel trace-cost OTel trace cost breakdown
cost-intel prompt-opt Prompt optimization analysis
cost-intel guard Budget enforcement guard
Configuration
Config lives at ~/.cost-intel/config.yaml (override with COST_INTEL_HOME):
budget:
monthly: 500
alerts:
slack_webhook_url: "https://hooks.slack.com/..."
email:
smtp_host: "smtp.gmail.com"
smtp_port: 587
from: "alerts@example.com"
to: "you@example.com"
quality:
weights:
accuracy: 0.5
relevance: 0.3
coherence: 0.2
License
MIT
Metadata
Release files for cost-intel 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cost_intel-0.1.0.tar.gz | 196.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cost_intel-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 237.4 kB
Release files / cost_intel-0.1.0.tar.gz
| Download URL | cost_intel-0.1.0.tar.gz |
|---|---|
| Size | 196.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cab4224538c4c8b23dd8e314e87a2819d1489e60eee3938798f44430dee9d5ca
|
|
BLAKE2b-256 checksum How to use checksums |
a76f0c356855fa59e4c6a4055b7ede0e315c827a3554b939b68139605b42bdfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency logRelease files / cost_intel-0.1.0-py3-none-any.whl
| Download URL | cost_intel-0.1.0-py3-none-any.whl |
|---|---|
| Size | 41.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dfc0b1778ccd3381ce3df0c4d4a797a174f06585e2767ef3a1f8cd7804edc3e7
|
|
BLAKE2b-256 checksum How to use checksums |
9dcb86a013375b4dc17c8566ed285890f7b2e4cab0250da8410765091b044b32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency log