aaix/laravel-ai-costs
最新稳定版本:v1.0.1
Composer 安装命令:
composer require aaix/laravel-ai-costs
包简介
Cost tracking for Laravel AI agents. Calculates API costs from usage metadata across providers.
README 文档
README
Laravel AI Costs
Cost tracking for Laravel AI agents. Calculates API costs from usage metadata across providers.
Zero-config cost calculation for Laravel AI responses. Pricing for 2,600+ models is resolved from the LiteLLM database (cached daily); local overrides take precedence.
composer require aaix/laravel-ai-costs
use Aaix\LaravelAiCosts\Concerns\TracksAiCost; class MyAgent implements \Laravel\Ai\Contracts\Agent { use TracksAiCost; // replaces Promptable } $agent = MyAgent::make(); $agent->prompt('...'); $agent->lastCost()->totalCostUsd; // 0.000345 $agent->totalCostUsd(); // sum across all prompts on this instance
Documentation
Full guide and API reference: aaix.github.io/laravel-ai-costs
License
统计信息
- 总下载量: 58
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-12