New API Usage Tracker for Openclaw

A specialized utility for querying and monitoring usage statistics, token consumption, and remaining balances from any new-api deployment.

wang48
v1.0.1
Mar 6, 2026
0
789
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install new-api-usage

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install new-api-usage using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is New API Usage Tracker?

The new-api-usage skill provides developers and system administrators with a streamlined way to track resource consumption across AI model endpoints. By integrating with Openclaw Skills, this tool enables real-time auditing of API credits, usage logs, and model-specific performance data without exposing sensitive configuration files.

This utility is designed with a focus on security, requiring explicit credential input for every session to prevent accidental data leaks. It converts abstract quota numbers into readable dollar amounts, helping teams stay within budget while managing multiple AI model providers through a unified interface.

New API Usage Tracker Use Cases

  • Monitoring remaining credit balance on a self-hosted or managed new-api instance.
  • Auditing token consumption patterns across different specific AI models.
  • Retrieving today's usage logs to debug unexpected high traffic or costs.
  • Generating JSON reports of API usage for export to external billing or analytics systems.

How New API Usage Tracker Works

  1. The user provides a target new-api base URL and a valid API key through the command interface.
  2. The agent executes secure, read-only GET requests to the designated usage or log endpoints.
  3. The skill filters records based on user-defined parameters such as timeframe or record limits.
  4. Data is aggregated by model or presented as a total summary, automatically converting quota units to currency values.
  5. Results are formatted as a clean CLI table or returned as a raw JSON payload for integration with other workflows.

New API Usage Tracker Setup

To use this tool within the Openclaw Skills framework, ensure your environment is configured for Python execution. No local configuration files are used, as credentials must be passed explicitly for security.

# Basic usage to check today's summary
uv run python scripts/query_usage.py --base-url https://api.example.com --key sk-your-key

New API Usage Tracker Data Schema & Taxonomy

The skill processes data from the new-api backend and organizes it into a structured format for easy analysis within Openclaw Skills:

Field Description
Quota Raw numerical units (Conversion: 500,000 quota = $1)
Usage Records Individual log entries containing token counts and timestamps
Model Aggregation Grouped data showing consumption per specific model ID
Balance Calculated remaining dollar value based on current quota

New API Usage Tracker Advanced Features

  • Model-level grouping to identify which specific LLMs are driving the highest costs.
  • Customizable limit filters to control the volume of log records retrieved.
  • Dedicated quota-only mode for quick balance checks without loading extensive logs.
  • Support for raw JSON output, enabling the output to be piped into other Openclaw Skills for automated reporting.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*