Free & open source
Credits for Laravel
Charge per use in any Laravel app: AI calls, exports, SMS, API requests. Give each user or team a balance, let plans top it up every period without a cron, reserve credits before an AI call and settle what it actually cost, meter usage without ever rounding a credit away, and know at any time where every credit came from and where it went.
- packstub/credits
- MIT, free for any project
- Packagist
What you’ll write
The real API, copied from the README, so you can judge the code before you install anything.
$hold = $team->credits()->hold(200, 'AI turn');$response = $agent->prompt($question);$hold->settleUsage(['ai.output_tokens' => $response->usage->outputTokens]);
What’s included
- Holds reserve an estimate before an AI call and settle the real cost after it; a worker that dies leaks nothing, the hold expires and gives the credits back
- Every grant is a lot with its own expiry, spent soonest-expiring first; refunds return to the lots they came from; plan allowances renew lazily, once, however many workers race
- Meters carry fractions of a credit to the next call, idempotency keys make retries safe, and credits:audit proves the ledger balances
One command, from Packagist
No accounts, no tokens. This package is free and open source — it installs straight from Packagist like any other Composer package.
Free, and maintained like everything else we ship.
- Is it really free?
- Yes — MIT licensed, free forever, for any kind of project. We build our own plugins with it, and sharing it makes the whole ecosystem better.
- How do I install it?
- Run the Composer command above. It installs from Packagist like any other package — no Packstub account needed.
- Can I use it in commercial projects?
- Absolutely. The MIT license covers personal, client, and commercial use without restrictions.
- Where do I report bugs or request features?
- On the GitHub repository — issues and pull requests are both very welcome.
- How does this relate to your paid plugins?
- Same team, same standards. Free tools like this one are part of how we build our commercial plugins, so they get maintained with the same care.