用途
cli-cost-usage 是 OmniRoute 项目下的一个命令行技能,主要用于从 CLI 查看成本明细、Token 用量和调用日志。它可以帮助用户按提供商、模型或日期范围筛选数据,导出用量报告,并检查每个连接的花费情况。
安装方式
可通过 npm 全局安装,或使用 npx 直接运行:
npm install -g omniroute # 或: npx omniroute
omniroute --version
主要能力与子命令
该工具围绕 cost、pricing、usage 三组子命令组织。
cost
查看成本信息。支持的标志包括:
--period <range>--since <date>--until <date>--group-by <field>--api-key <key>--limit <n>
示例:
omniroute cost
pricing
定价相关操作,包含多个子命令:
pricing:示例omniroute pricingpricing sync:标志--provider <p>、--force;示例omniroute pricing syncpricing list:标志--provider <p>、--model <m>、--limit <n>;示例omniroute pricing listpricing get <model>:示例omniroute pricing get <model>pricing defaults:示例omniroute pricing defaultspricing show:示例omniroute pricing showpricing set:标志--input <p>、--output <p>、--cache-read <p>、--cache-write <p>;示例omniroute pricing setpricing diff:标志--model <m>;示例omniroute pricing diff
usage
用量相关操作,包含多个子命令:
usage:示例omniroute usageusage analytics:标志--period <range>、--provider <id>;示例omniroute usage analyticsusage budget:示例omniroute usage budgetusage list:示例omniroute usage listusage get [scope]:示例omniroute usage get [scope]usage set <amount>:标志--scope <s>、--period <p>;示例omniroute usage set <amount>usage reset [scope]:示例omniroute usage reset [scope]usage quota:标志--provider <id>、--check;示例omniroute usage quotausage logs:标志--limit <n>、--search <q>、--since <ts>、--follow、--api-key <k>;示例omniroute usage logsusage utilization:标志--api-key <k>;示例omniroute usage utilizationusage history:标志--limit <n>;示例omniroute usage historyusage proxy-logs:标志--limit <n>;示例omniroute usage proxy-logs
适用场景
该工具适合需要在命令行环境中监控 AI 调用成本、分析 Token 用量、查看调用日志、设置预算与配额、检查利用率以及导出用量报告的用户,例如开发者、运维人员或团队管理者。
限制
资料中未提供关于收费、价格、平台支持范围、具体效果或更多使用步骤的说明,这些信息暂未提供。