Model Pricing Calculator for Openclaw

A specialized tool for fetching, unifying, and calculating standardized pricing ratios across multiple AI model providers and API platforms.

zhengmengkaizmk
v1.0.0
Mar 24, 2026
0
705
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install model-pricing-calculator

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 model-pricing-calculator 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 Model Pricing Calculator?

The Model Pricing Calculator is a robust utility designed to solve the complexity of managing disparate pricing structures from various AI API aggregation platforms. By leveraging Openclaw Skills, this tool fetches raw pricing data and converts it into a unified system of model ratios, completion ratios, and group ratios based on a consistent base price of $0.002 per 1K tokens.

This skill ensures that developers can maintain a single source of truth for model costs, even when the same model is offered by different providers at varying price points. It handles the heavy lifting of reverse-calculating ratios from target prices and provides detailed snapshot comparisons to track pricing changes over time.

Model Pricing Calculator Use Cases

  • Normalizing pricing data from multiple AI API providers into a single schema.
  • Calculating completion and model ratios for new LLM releases automatically.
  • Reverse-engineering internal ratio configurations from public USD price lists.
  • Auditing price changes across platforms using automated snapshot diffing.
  • Integrating new API pricing endpoints into an existing AI agent ecosystem.

How Model Pricing Calculator Works

  1. The skill identifies target platforms and API endpoints defined in the pricing configuration file.
  2. It executes a Python-based fetching engine that queries these endpoints for raw pricing data.
  3. The system applies a standardized pricing formula to calculate Model Ratios (relative to the $0.002 base) and Completion Ratios.
  4. It unifies duplicate models across platforms using a 'first-source wins' strategy while mapping price differences to specific group ratios.
  5. A comparison is performed against the latest stored snapshot to identify and report any price fluctuations or new model additions.
  6. The final structured JSON output is generated, ready for consumption by routing or billing systems.

Model Pricing Calculator Setup

To get started with this component of Openclaw Skills, ensure you have Python installed and configure your provider URLs.

# 1. Update your platform URLs in references/pricing_urls.json
# 2. Run the calculation script to generate the first snapshot
python scripts/fetch_and_calculate.py

# 3. Filter for specific models or groups as needed
python scripts/fetch_and_calculate.py --models "gpt-4*,claude-*"

Model Pricing Calculator Data Schema & Taxonomy

The skill organizes pricing data into a three-tier hierarchy to ensure granular control over costs:

Component Description Calculation Logic
Model Ratio Base cost multiplier for a specific model InputPrice / 0.002
Completion Ratio Multiplier for output tokens vs input tokens OutputPrice / InputPrice
Group Ratio Platform-specific adjustment factor Applied to final cost

All data is persisted in data/latest_snapshot.json to allow for historical diffing and state management.

Model Pricing Calculator Advanced Features

  • Wildcard filtering for models and groups (e.g., gpt-4*) to perform targeted updates.
  • Automated snapshot diffing that highlights added, removed, or changed pricing values between runs.
  • Cross-platform unification strategy that maintains ratio integrity while allowing for platform-specific price adjustments.
  • Reverse-calculation mode to determine necessary ratios based on specific USD price targets.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*