定制 aaix/laravel-ai-costs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 Logo

Laravel AI Costs

Cost tracking for Laravel AI agents. Calculates API costs from usage metadata across providers.

Latest Version on Packagist Total Downloads License

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

MIT

统计信息

  • 总下载量: 58
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-12