Current collected state Current
Observed since 21 Oct, 10:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Track AI API costs, token usage, and prompt quality across all providers
Track AI API costs, token usage, and prompt quality across all providers — Anthropic, OpenAI, Google, Mistral, and more.
pip install ai-cost-auditor
With provider SDKs:
pip install "ai-cost-auditor[anthropic]"
pip install "ai-cost-auditor[openai]"
pip install "ai-cost-auditor[all]"
from ai_cost_auditor import CostTracker
import anthropic
tracker = CostTracker()
client = tracker.wrap_anthropic(anthropic.Anthropic())
# Use exactly like the normal client — tracking is automatic
resp = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain async/await in Python"}]
)
# View stats
stats = tracker.get_stats(days=7)
print(f"Cost: ${stats['period']['total_cost_usd']:.4f}")
# Generate HTML report with charts
tracker.generate_report("report.html")
tracker.track()| Provider | Models |
|---|---|
| Anthropic | claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5, claude-3.x |
| OpenAI | gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, o1, o3-mini |
| gemini-1.5-pro, gemini-1.5-flash, gemini-2.0-flash | |
| Mistral | mistral-large, mistral-small, codestral |
| Cohere | command-r-plus, command-r |
# Analyze prompt quality
ai-cost-auditor analyze "Write a function to validate email addresses"
# Show stats
ai-cost-auditor stats --days 7
# Generate report and open in browser
ai-cost-auditor report --days 30 --open
tracker.track(
provider="google",
model="gemini-1.5-flash",
input_tokens=300,
output_tokens=120,
prompt_text="Your prompt here",
)
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 28 May 2026 | 6 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 10:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7d046bbbdbcc2f3b7785dbcaedf6d71806e14da78e56d06af11be8512ac5a654