← Back to Skills Marketplace
npfaerber

Token Cost Estimator

by npfaerber · GitHub ↗ · v1.0.1
cross-platform ✓ Security Clean
501
Downloads
1
Stars
2
Active Installs
2
Versions
Install in OpenClaw
/install token-cost-estimator
Description
Estimate API token costs from OpenClaw session transcripts. Analyzes all agent sessions to calculate what you'd pay on per-token pricing vs subscription plan...
Usage Guidance
This skill is internally consistent with its purpose, but it reads your OpenClaw session transcripts (sensitive conversation data) from ~/.openclaw/agents. Before running: (1) inspect the provided Python script so you understand exactly what is read and what is output; (2) run it locally in a safe environment (don't pipe results to unknown services); (3) update pricing constants to current rates if you need accurate numbers; (4) be aware the script uses a rough token approximation (chars/4) and omits some internal system/tool tokens, so treat results as estimates; (5) avoid granting autonomous execution to this skill unless you trust it to run on your transcripts without exfiltrating them.
Capability Analysis
Type: OpenClaw Skill Name: token-cost-estimator Version: 1.0.1 The OpenClaw skill 'token-cost-estimator' is benign. Its stated purpose is to estimate API token costs by analyzing local OpenClaw session transcripts. The Python script in `SKILL.md` correctly implements this by reading `.jsonl` files from `~/.openclaw/agents/<agent>/sessions/`. It performs no network operations, executes no external commands, and does not attempt to access or exfiltrate sensitive data. The markdown instructions are clear and do not contain any prompt injection attempts to mislead the AI agent into malicious actions.
Capability Assessment
Purpose & Capability
The name/description match the instructions: the SKILL.md provides a Python script that reads OpenClaw session JSONL files from ~/.openclaw/agents/... and computes token/cost estimates. No unrelated credentials, binaries, or services are requested.
Instruction Scope
Instructions explicitly read user session transcripts from ~/.openclaw/agents/<agent>/sessions/*.jsonl and compute estimates locally. This is expected for the stated purpose but entails accessing potentially sensitive conversation data; the script does not instruct any network exfiltration, but outputs should be handled carefully.
Install Mechanism
No install spec or code files beyond the SKILL.md; the skill is instruction-only and does not download or install external artifacts.
Credentials
No environment variables, credentials, or config paths are required beyond the explicit session file path. Access to the user's home session files is proportional to the cost-estimation purpose, though it is sensitive data.
Persistence & Privilege
The skill is not marked always:true and does not request system-wide changes. Model invocation is allowed (platform default), which means the agent could run the instructions autonomously if permitted — combine that with transcript access only if you trust the skill.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install token-cost-estimator
  3. After installation, invoke the skill by name or use /token-cost-estimator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Fixed a bug in the estimation script where the total input/output token counters did not include per-agent totals in the grand total. - Token cost estimations now accurately reflect all agent session data combined. - Minor script adjustments to improve clarity of total cost output.
v1.0.0
Initial release of Token Cost Estimator for OpenClaw sessions: - Estimates API token costs by analyzing local agent session transcripts. - Differentiates input/output token costs and accounts for context re-sending in conversations. - Considers caching effects with adjustable cache hit rates for realistic billing. - Compares estimated API costs to popular subscription plans for easy break-even analysis. - Provides practical guidance on API cost estimation accuracy and transcript limitations.
Metadata
Slug token-cost-estimator
Version 1.0.1
License
All-time Installs 2
Active Installs 2
Total Versions 2
Frequently Asked Questions

What is Token Cost Estimator?

Estimate API token costs from OpenClaw session transcripts. Analyzes all agent sessions to calculate what you'd pay on per-token pricing vs subscription plan... It is an AI Agent Skill for Claude Code / OpenClaw, with 501 downloads so far.

How do I install Token Cost Estimator?

Run "/install token-cost-estimator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Token Cost Estimator free?

Yes, Token Cost Estimator is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Token Cost Estimator support?

Token Cost Estimator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Token Cost Estimator?

It is built and maintained by npfaerber (@npfaerber); the current version is v1.0.1.

💬 Comments