← 返回
AI智能 Key 中文

OpenRouter Usage

Fetch real-time OpenRouter usage totals and historical per-model spend. Use when the user asks for usage, spend, cost breakdown, or OpenRouter stats. Not for system health or non-LLM metrics.
获取实时 OpenRouter 使用总量和历史各模型费用。用户询问使用情况、费用、成本明细或 OpenRouter 统计时使用。不适用于系统健康或非 LLM 指标。
rosseyre
AI智能 clawhub v1.1.3 1 版本 100000 Key: 需要
★ 1
Stars
📥 1,785
下载
💾 64
安装
1
版本
#latest

概述

OpenRouter Usage Monitor

What this skill does

Retrieves OpenRouter usage and cost data via:

  • Live totals (Today / Week / Month) from /auth/key
  • Historical per-model breakdown from /activity (completed UTC days only)

How to run (recommended)

Set environment variables (recommended) or create a credentials.env file:

export OPENROUTER_API_KEY=your_key_here
export OPENROUTER_MGMT_KEY=your_mgmt_key_here  # optional, enables model breakdown

Then execute: python3 scripts/stats.py

Alternatively, create credentials.env in the skill directory:

OPENROUTER_API_KEY=your_key_here
OPENROUTER_MGMT_KEY=your_mgmt_key_here

Fallback method (no Python)

If Python is unavailable, query endpoints directly:

Live totals

curl -sS -H "Authorization: Bearer $OPENROUTER_API_KEY"

https://openrouter.ai/api/v1/auth/key

Per-model activity (7d)

curl -sS -H "Authorization: Bearer $OPENROUTER_MGMT_KEY"

https://openrouter.ai/api/v1/activity


Configuration

Required:

  • OPENROUTER_API_KEY - Required for real-time usage totals and balance

Optional:

  • OPENROUTER_MGMT_KEY - Enables per-model spend breakdown from activity endpoint

Credentials can be provided via:

  1. Environment variables (recommended for security)
  2. credentials.env file in skill directory (fallback)

Output format

💰 OpenRouter Usage

Today: $X.XX* | Week: $X.XX | Month: $X.XX

Balance: $X.XX / $X.XX

Recent Models (7d):

• model-name: $X.XX (N)

...

* indicates live totals that may not yet appear in model breakdowns.


Edge cases

  • /activity only returns completed UTC days.
  • Today’s spend may appear in totals but not per-model data until next UTC rollover.
  • Invalid keys → 401/403.
  • Rate limiting → 429.
  • Network failures should be retried or surfaced.

版本历史

共 1 个版本

  • v1.1.3 当前
    2026-03-29 01:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,883
ai-intelligence

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 418 📥 115,240
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,467