model-usage

Analyze local JSON logs to summarize token usage and costs for Codex or Claude models.

55|6|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/NJX-njx/opensoul --skill model-usage-njx-njx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-usage
Source: https://github.com/NJX-njx/opensoul/tree/main/skills/model-usage
Command: npx skills add https://github.com/NJX-njx/opensoul --skill model-usage-njx-njx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill enables users to track and analyze per-model token consumption and cost data from local logs, facilitating usage optimization and cost management.

Core Features & Use Cases

  • Usage Summarization: Generates summaries of model usage costs for Codex or Claude based on local JSON logs.
  • Model Breakdown Analysis: Provides detailed cost breakdowns per model for recent days or specific time ranges.
  • Use Case: A developer wants to evaluate which models incur the highest costs over the past 30 days to optimize API usage and budgets.

Quick Start

Fetch cost logs via CodexBar CLI or from a JSON file, then run the script to generate a summary in plain text or JSON format.

Frequently Asked Questions about model-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze token usage and costs from local JSON logs?

To analyze token usage and costs from local JSON logs, you can run a Python script that reads your JSON cost log file or standard input to compute and summarize per-model consumption data. The script generates a summary in plain text or JSON format.

Can I filter model cost breakdowns by recent days?

Yes, you can filter model cost breakdowns by recent days. The analysis script supports filtering by specific time ranges, allowing you to evaluate which models incur the highest costs over a selected period for budget optimization.

Does this tool work with both Codex and Claude model logs?

Yes, this tool works with both Codex and Claude model logs. It analyzes local JSON cost logs to compute and summarize token usage and associated costs specifically for Codex or Claude models, providing model-specific cost insights.

What is the best way to track per-model API costs for budget optimization?

The best way to track per-model API costs for budget optimization is to parse local JSON logs with a Python script that computes token usage and generates detailed cost breakdowns per model, enabling you to identify high-cost models over specific time ranges.

Do I need a specific environment to run the token usage analysis script?

You need a Python environment to execute the token usage analysis script. The script processes a JSON cost log input, which can be fetched via CodexBar CLI or provided from a JSON file, to output usage and cost summaries.

Why does the cost summary require a JSON file as input?

The cost summary requires a JSON file as input because the analysis script parses structured JSON log data to accurately compute token counts and associated costs per model. This structured format ensures precise tracking and breakdown of usage metrics.