{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-cost-tracker",
    "name": "OpenClaw Cost Tracker",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
    "canonicalUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/openclaw-cost-tracker",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-cost-tracker",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/cost_tracker.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openclaw-cost-tracker"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/openclaw-cost-tracker",
    "agentPageUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OpenClaw Cost Tracker",
        "body": "Parse OpenClaw session files to compute per-model token usage, costs, and daily spend trends. Works with any OpenClaw installation — no API keys or external services needed."
      },
      {
        "title": "Usage",
        "body": "# All-time cost report\npython3 scripts/cost_tracker.py\n\n# Last 7 days\npython3 scripts/cost_tracker.py --days 7\n\n# Today only\npython3 scripts/cost_tracker.py --days 1\n\n# Since a specific date\npython3 scripts/cost_tracker.py --since 2026-02-01\n\n# JSON output for dashboards/integrations\npython3 scripts/cost_tracker.py --days 30 --format json\n\n# Custom agents directory\npython3 scripts/cost_tracker.py --agents-dir /path/to/agents"
      },
      {
        "title": "What It Reports",
        "body": "Per-model breakdown:\n\nTotal cost, tokens, and request count\nInput/output/cache token split\nVisual percentage bar\n\nDaily spend: Bar chart of cost per day (text) or structured array (JSON).\n\nGrand totals: Combined cost, tokens, and requests across all models."
      },
      {
        "title": "How It Works",
        "body": "Auto-discovers the OpenClaw agents directory (~/.openclaw/agents)\nScans all agent session JSONL files (filtered by mtime for speed)\nExtracts message.usage and message.model from each entry\nAggregates by model and by day\nOutputs formatted report or JSON"
      },
      {
        "title": "JSON Output Schema",
        "body": "{\n  \"models\": [\n    {\n      \"model\": \"claude-opus-4-6\",\n      \"totalTokens\": 220800000,\n      \"inputTokens\": 3200,\n      \"outputTokens\": 390800,\n      \"cacheReadTokens\": 149400000,\n      \"cacheWriteTokens\": 1200000,\n      \"totalCost\": 528.55,\n      \"requestCount\": 2088\n    }\n  ],\n  \"daily\": [\n    { \"date\": \"2026-02-20\", \"cost\": 37.14, \"byModel\": { \"opus-4-6\": 35.0, \"sonnet-4\": 2.14 } }\n  ],\n  \"grandTotal\": { \"totalCost\": 580.11, \"totalTokens\": 269800000, \"totalRequests\": 3122 },\n  \"meta\": { \"agentsDir\": \"...\", \"filesScanned\": 65, \"entriesParsed\": 3122, \"range\": \"7d\" }\n}"
      },
      {
        "title": "Integration",
        "body": "Feed JSON output into dashboards, alerting, or budgeting tools. The daily array is ready for charting. Set up a cron to track spend over time:\n\n# Daily cost snapshot to file\n0 0 * * * python3 /path/to/cost_tracker.py --days 1 --format json >> ~/cost-log.jsonl"
      },
      {
        "title": "Requirements",
        "body": "Python 3.8+\nOpenClaw installed with session data in ~/.openclaw/agents/\nNo external dependencies (stdlib only)"
      }
    ],
    "body": "OpenClaw Cost Tracker\n\nParse OpenClaw session files to compute per-model token usage, costs, and daily spend trends. Works with any OpenClaw installation — no API keys or external services needed.\n\nUsage\n# All-time cost report\npython3 scripts/cost_tracker.py\n\n# Last 7 days\npython3 scripts/cost_tracker.py --days 7\n\n# Today only\npython3 scripts/cost_tracker.py --days 1\n\n# Since a specific date\npython3 scripts/cost_tracker.py --since 2026-02-01\n\n# JSON output for dashboards/integrations\npython3 scripts/cost_tracker.py --days 30 --format json\n\n# Custom agents directory\npython3 scripts/cost_tracker.py --agents-dir /path/to/agents\n\nWhat It Reports\n\nPer-model breakdown:\n\nTotal cost, tokens, and request count\nInput/output/cache token split\nVisual percentage bar\n\nDaily spend: Bar chart of cost per day (text) or structured array (JSON).\n\nGrand totals: Combined cost, tokens, and requests across all models.\n\nHow It Works\nAuto-discovers the OpenClaw agents directory (~/.openclaw/agents)\nScans all agent session JSONL files (filtered by mtime for speed)\nExtracts message.usage and message.model from each entry\nAggregates by model and by day\nOutputs formatted report or JSON\nJSON Output Schema\n{\n  \"models\": [\n    {\n      \"model\": \"claude-opus-4-6\",\n      \"totalTokens\": 220800000,\n      \"inputTokens\": 3200,\n      \"outputTokens\": 390800,\n      \"cacheReadTokens\": 149400000,\n      \"cacheWriteTokens\": 1200000,\n      \"totalCost\": 528.55,\n      \"requestCount\": 2088\n    }\n  ],\n  \"daily\": [\n    { \"date\": \"2026-02-20\", \"cost\": 37.14, \"byModel\": { \"opus-4-6\": 35.0, \"sonnet-4\": 2.14 } }\n  ],\n  \"grandTotal\": { \"totalCost\": 580.11, \"totalTokens\": 269800000, \"totalRequests\": 3122 },\n  \"meta\": { \"agentsDir\": \"...\", \"filesScanned\": 65, \"entriesParsed\": 3122, \"range\": \"7d\" }\n}\n\nIntegration\n\nFeed JSON output into dashboards, alerting, or budgeting tools. The daily array is ready for charting. Set up a cron to track spend over time:\n\n# Daily cost snapshot to file\n0 0 * * * python3 /path/to/cost_tracker.py --days 1 --format json >> ~/cost-log.jsonl\n\nRequirements\nPython 3.8+\nOpenClaw installed with session data in ~/.openclaw/agents/\nNo external dependencies (stdlib only)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
    "publisherUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
    "owner": "pfrederiksen",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-cost-tracker",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent.md"
  }
}