Skip to main content

A smart command-line tool for tracking AI credit consumption across billing cycles

Project description

AI Usage 💳

A smart command-line tool for tracking AI credit consumption across billing cycles. Designed for AI-powered development tools like Cursor, GitHub Copilot, and other subscription-based AI services.

🎯 Why This Matters

Managing AI credits effectively can save you money and frustration:

  • Avoid overages: Get warned before you hit pay-as-you-go pricing
  • Optimize usage: Know when you have credits to spare for big projects
  • Track trends: See if you're conserving or burning through credits
  • Plan ahead: Project your usage through the end of the billing cycle

But my AI already shows percentage used

Yes it might! But that's only half the story. At your current rate, will you still have creates to spare at the end of the period? How much? Are you going over?

If you have a bunch extra, you can switch to a smarter model or tackle a huge upcoming feature / project sooner rather than later. And visa versa if you're going to be over.

This is a simple CLI tool. But I find knowing the answers with clear numbers for those questions very useful.

✨ Features

  • 📊 Real-time Usage Analysis: Compares your credit usage against time elapsed in billing cycle
  • 🎨 Color-Coded Feedback: Green for conserving, red for warning, instant visual feedback
  • 🔮 Smart Projections: Predicts remaining credits at renewal based on current usage rate
  • 📅 Flexible Billing Cycles: Works with any renewal day of the month
  • Zero Dependencies: Pure Python with no external packages required
  • 🧮 Accurate Calculations: Handles month boundaries and varying cycle lengths
  • 🔒 Privacy First: No web services, no logins, no data collection—runs entirely offline

📸 Example Output

When you're conserving credits (good):

💳 Credit Usage Analysis
==================================================
Current Date: 2025-10-12
Billing Cycle: Day 12 of 31
Renewal Day: 1st of the month

🎯 Analysis:
  Credits Used: 25.0%
  Difference: -13.7%
  Status: CONSERVING WELL

🔮 Projection (at current rate):
  Expected usage by renewal: 64.6%
  Expected surplus: 35.4%

✅ Great! You're conserving credits - using 13.7% slower than time
   You'll have ~35.4% credits remaining at renewal.

When you're using too fast (warning):

💳 Credit Usage Analysis
==================================================
Current Date: 2025-10-12
Billing Cycle: Day 12 of 31
Renewal Day: 1st of the month

🎯 Analysis:
  Credits Used: 75.0%
  Difference: +36.3%
  Status: USING TOO FAST

🔮 Projection (at current rate):
  Expected usage by renewal: 193.8%
  Expected surplus: -93.8%

⚠️  WARNING: You're using credits 36.3% faster than time!
   💥 You'll exceed 100% usage by 93.8% before renewal!

🚀 Installation

From PyPI (when published)

uv pip install aiusage

From Source

git clone https://github.com/mikeckennedy/aiusage.git
cd aiusage
uv pip install -e .

📖 Usage

Basic Usage

aiusage 15 45  # Renewal on 15th, 45% used
aiusage 25     # Default renewal day (1st), 25% used

Finding Your Current Usage

For Cursor:

  1. Open Cursor Settings
  2. Navigate to your subscription/usage page
  3. Look for "Usage this billing period" or similar
  4. Use the percentage shown

For GitHub Copilot:

  • Check your GitHub billing page for usage metrics

🔧 How It Works

The tool performs three key calculations:

  1. Time Progress: Calculates how far through your billing cycle you are

    • Example: Day 18 of 31 = 58.1% through cycle
  2. Usage Ratio: Compares credit usage to time progress

    • Ratio > 1.0 = Using too fast ⚠️
    • Ratio < 1.0 = Conserving well ✅
    • Ratio = 1.0 = On track 📊
  3. Projection: Estimates final usage based on current rate

    • Daily rate = Current % ÷ Days elapsed
    • Projected = Daily rate × Total cycle days

📋 Requirements

  • Python 3.13+ (uses modern type hints)
  • No external dependencies
  • Works on macOS, Linux, and Windows

💡 Use Cases

Scenario 1: Pre-Project Planning

You're at 30% usage with 40% of your cycle remaining. You have credits to spare—perfect time to tackle that AI-intensive refactoring project!

Scenario 2: Usage Warning

You're at 80% usage with 50% of your cycle remaining. Time to be more selective with AI requests or risk hitting overages.

Scenario 3: End-of-Cycle Push

You're at 60% usage with only 5 days left. Use those remaining credits before they reset!

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests

📄 License

MIT License - feel free to use this tool in your own projects!

🙏 Acknowledgments

Built for developers who want to maximize their AI tool subscriptions without breaking the bank.


Pro Tip: The package installs a aiusage command globally:

# If your renewal day is the 15th of the month, and usage is 45%
aiusage 15 45

# Or use the default renewal day (1st)
aiusage 25

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiusage-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiusage-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file aiusage-0.1.0.tar.gz.

File metadata

  • Download URL: aiusage-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for aiusage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 93eb079549f2ecc63b28d3b6a927eafe228d5e43ff984f57bf94ed2e147ee01b
MD5 ffff95f9ecc1889fc1a156126e3c25f5
BLAKE2b-256 a65806d67a4466264c0c31bd5d7748d8519e0e3c80afa2d9727ba3396793189b

See more details on using hashes here.

File details

Details for the file aiusage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aiusage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for aiusage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cac6f8b9de2186fa510bb7abb0c0add8f91db1d1ffaaad272b0417f195f559e
MD5 9d0ed783f3bbbe4075df3598c1525613
BLAKE2b-256 2c7e5f1eb59cb0daecf04cb7b9c45197354b9c34e2c7d5fca43f64f058879629

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page