dannivn's avatar

Zero-Code AI Usage Dashboard for Laravel: Check Out Larai Tracker

Hi Laracasts , Lately, I've been integrating a lot of AI features into Laravel apps (using OpenAI, Gemini, etc.), and one recurring headache is keeping track of token usage and real API costs without adding messy logging code everywhere.

To solve this cleanly, I created Larai Tracker – an open-source package that tracks everything "invisibly" with zero changes to your existing code.

How it works (briefly):

  • It listens to Laravel's native ResponseReceived event from the HTTP Client.
  • Parses token counts directly from provider headers/body (supports OpenAI, Gemini, Azure OpenAI, OpenRouter out of the box).
  • Calculates costs in real-time using current pricing rates.
  • Gives you a nice dashboard at /larai-tracker with:
    • Total spend so far
    • Daily burn rate & trends
    • Token input/output breakdowns
    • Recent AI call logs

Main benefits:

  • No wrappers or middleware needed around your API calls
  • Works seamlessly with Laravel 10–12
  • Built-in auth gate for security
  • Dark mode + clean UI

Quick install:

composer require gometap/larai-tracker
php artisan vendor:publish --tag="larai-tracker-migrations"
php artisan migrate
# Optional: publish config/views if you want to customize
php artisan vendor:publish --tag="larai-tracker-config"
php artisan vendor:publish --tag="larai-tracker-views"
1 like
0 replies

Please or to participate in this conversation.