model-usage
Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.
Install via CLI (Recommended)
clawhub install openclaw/openclaw/skills/model-usageWhat This Skill Does
The model-usage skill provides detailed insights into the cost and usage of AI models, specifically Codex and Claude, as logged by the CodexBar CLI. It allows users to retrieve summaries of model expenses, either focusing on the most recently used model for a given day or providing a comprehensive breakdown of all models used over time. This skill is invaluable for developers and teams looking to monitor and manage their AI operational costs effectively. It can process cost data directly from the CodexBar CLI or from a provided JSON file, offering flexibility in how usage data is obtained and analyzed. The output can be presented in a human-readable text format or a structured JSON format for further programmatic use.
Installation
To install the model-usage skill, use the following command:
clawhub install openclaw/openclaw/skills/model-usage
Ensure you have the CodexBar CLI installed and configured. Refer to the CodexBar CLI documentation for installation and setup instructions.
Use Cases
This skill is highly versatile and can be applied in several scenarios:
- Cost Monitoring: Track the daily or cumulative costs associated with different AI models (Codex, Claude) to understand spending patterns.
- Model Optimization: Identify which models are incurring the highest costs, enabling informed decisions about model selection and potential cost-saving optimizations.
- Resource Allocation: Gain insights into model usage to better allocate computational resources and budget.
- Auditing and Reporting: Generate reports on AI model expenses for financial auditing or internal management purposes.
- Development Workflow Integration: Integrate model usage summaries into development pipelines or dashboards for continuous monitoring.
Example Prompts
- "Show me the current most expensive model I used today with Codex."
- "Summarize the total cost for all Claude models from the CodexBar logs."
- "Provide a JSON output of my Codex model usage for the last month."
Tips & Limitations
- Data Source: The accuracy of the
model-usageskill's output depends entirely on the quality and completeness of the data logged by the CodexBar CLI. Ensure CodexBar is properly configured to capture all relevant usage. - CodexBar CLI Dependency: This skill relies on the CodexBar CLI. Make sure it's installed and accessible in your environment. The script uses
codexbar cost --format jsonby default. - Linux Support: Guidance for Linux CLI installation paths is still pending documentation. Users on Linux may need to manually configure paths.
- Token vs. Cost: The output primarily focuses on cost. CodexBar's raw output does not differentiate tokens by model breakdown, so the summary is cost-centric.
- 'Current Model' Logic: The 'current model' feature identifies the most costly model from the most recent daily entry. If
modelBreakdownsare absent, it falls back tomodelsUsed. You can explicitly specify a model using the--model <name>flag. - Input Flexibility: You can pipe output from
codexbar costdirectly into the script via stdin or specify a file using the--inputflag for greater control over data processing.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-openclaw-model-usage": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: code-execution, file-read
Related Skills
apple-notes
Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.
sherpa-onnx-tts
Local text-to-speech via sherpa-onnx (offline, no cloud)
goplaces
Query Google Places for text search, place details, resolve, reviews, or scriptable JSON via goplaces.
skill-creator
Create, edit, improve, tidy, review, audit, or restructure AgentSkills and SKILL.md files.
video-frames
Extract frames or short clips from videos using ffmpeg.