{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-cost-monitor",
    "name": "Agent Cost Monitor",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/neal-collab/agent-cost-monitor",
    "canonicalUrl": "https://clawhub.ai/neal-collab/agent-cost-monitor",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-cost-monitor",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-cost-monitor",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "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-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.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/agent-cost-monitor"
    },
    "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/agent-cost-monitor",
    "agentPageUrl": "https://openagent3.xyz/skills/agent-cost-monitor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-cost-monitor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-cost-monitor/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": "Agent Cost Monitor — Know What Your Agents Cost",
        "body": "Track token usage, costs, and efficiency across all your OpenClaw agents in real-time. Get alerts before you blow your budget."
      },
      {
        "title": "The Problem",
        "body": "Running multiple agents is powerful — but expensive if you're not watching:\n\nWhich agent is burning the most tokens?\nAre heartbeats wasting money on expensive models?\nIs caching actually saving you anything?\nWhen will you hit your weekly rate limit?"
      },
      {
        "title": "What This Skill Does",
        "body": "When triggered (via cron or manually), the agent:\n\nChecks session_status for each agent\nCalculates per-agent and total costs\nCompares against budget thresholds\nSends alerts if limits are approaching\nSuggests optimization moves"
      },
      {
        "title": "Usage",
        "body": "Ask your monitoring agent (or any agent with this skill):\n\n\"Give me a cost report for all agents\"\n\"Which agent used the most tokens today?\"\n\"Am I going to hit my rate limit this week?\""
      },
      {
        "title": "Automated Daily Report (Cron)",
        "body": "{\n  \"name\": \"Daily Cost Report\",\n  \"schedule\": { \"kind\": \"cron\", \"expr\": \"0 20 * * *\", \"tz\": \"Europe/Berlin\" },\n  \"payload\": {\n    \"kind\": \"agentTurn\",\n    \"message\": \"Run a cost report across all agents. Check session_status for each. Report: total tokens, cost per agent, top spender, budget warnings. Send summary to user.\"\n  },\n  \"sessionTarget\": \"isolated\",\n  \"delivery\": { \"mode\": \"announce\" }\n}"
      },
      {
        "title": "Cost Report Format",
        "body": "When generating a report, use this structure:\n\n## 💰 Agent Cost Report — [Date]\n\n### Per-Agent Breakdown\n| Agent | Model | Tokens (24h) | Est. Cost | Status |\n|-------|-------|-------------|-----------|--------|\n| Central | Opus 4.6 | 125K | $1.87 | ⚠️ High |\n| Techops | Opus 4.6 | 89K | $1.33 | ✅ Normal |\n| Atlas | Sonnet 4.5 | 45K | $0.27 | ✅ Low |\n| Closer | Haiku 4.5 | 23K | $0.02 | ✅ Minimal |\n| Heartbeats | Ollama | 12K | $0.00 | ✅ Free |\n\n### Summary\n- **Total 24h:** 294K tokens (~$3.49)\n- **Projected weekly:** ~$24.43\n- **Budget:** $20/week → ⚠️ 122% projected\n\n### Recommendations\n1. Move Techops from Opus → Sonnet for routine tasks (-40% cost)\n2. Increase heartbeat interval from 15m → 30m\n3. Enable context pruning on Atlas (idle sessions burning cache)"
      },
      {
        "title": "Model Cost Reference",
        "body": "Use these rates for estimation (as of 2026):"
      },
      {
        "title": "Anthropic (Claude OAuth / API)",
        "body": "ModelInput/1MOutput/1MCache Read/1MCache Write/1MOpus 4.6$5.00$25.00$0.50$6.25Sonnet 4.5$3.00$15.00$0.30$3.75Haiku 4.5$1.00$5.00$0.08$1.25"
      },
      {
        "title": "Free Options",
        "body": "ModelCostUse ForOllama (local)$0Heartbeats, simple tasksGemini OAuth$0*Fallback (rate limited)\n\n*Free tier with rate limits"
      },
      {
        "title": "Quick Wins (Do These First)",
        "body": "Heartbeats on Ollama\n\n{ \"heartbeat\": { \"model\": \"ollama/llama3.2:3b\" } }\n\nSaves: 100% of heartbeat costs (can be $5-10/week with Opus)\n\nHaiku Cache Retention Off\n\n{ \"anthropic/claude-haiku-4-5\": { \"params\": { \"cacheRetention\": \"none\" } } }\n\nSaves: Cache write costs on cheap model (not worth caching)\n\nContext Pruning\n\n{ \"contextPruning\": { \"mode\": \"cache-ttl\", \"ttl\": \"5m\" } }\n\nSaves: Stale context re-reads on every turn\n\nOpus/Sonnet Cache Retention Long\n\n{ \"anthropic/claude-opus-4-6\": { \"params\": { \"cacheRetention\": \"long\" } } }\n\nSaves: Re-sending system prompt every turn (biggest single saving)"
      },
      {
        "title": "Model Tiering (Biggest Impact)",
        "body": "Task TypeUse ThisNot ThisSavingCoordination, complex reasoningOpus—JustifiedFinance, data analysisSonnetOpus-40%Sales drafts, marketing copyHaikuSonnet-67%Heartbeats, health checksOllamaAny paid-100%Tweet draftsHaiku or GrokOpus-80%"
      },
      {
        "title": "Session Management",
        "body": "Daily reset: Sessions auto-clear at a set hour (reduces token accumulation)\n\n{ \"session\": { \"reset\": { \"mode\": \"daily\", \"atHour\": 4, \"idleMinutes\": 45 } } }\n\nMemory flush: Save important context before compaction\n\n{ \"compaction\": { \"memoryFlush\": { \"enabled\": true } } }"
      },
      {
        "title": "Alert Thresholds",
        "body": "Configure in your monitoring agent's memory:\n\n## Budget Alerts\n- Daily budget: $5.00 (warn at 80% = $4.00)\n- Weekly budget: $20.00 (warn at 70% = $14.00)\n- Per-agent daily max: $2.00\n- Alert channel: Telegram DM"
      },
      {
        "title": "Integration with DevOps Agent",
        "body": "If you have a DevOps/monitoring agent (e.g. your DevOps agent), add to its AGENTS.md:\n\n## Cost Monitoring\n- Run daily cost report at 20:00\n- Alert if any agent exceeds $2/day\n- Weekly summary every Monday 09:00\n- Track trends: is usage going up or down?"
      },
      {
        "title": "FAQ",
        "body": "Q: Does this skill make API calls?\nA: No. It uses OpenClaw's built-in session_status tool. No external APIs, no additional costs.\n\nQ: How accurate are cost estimates?\nA: Based on published model pricing. Actual costs may vary with caching hits. Estimates are conservative (slightly high).\n\nQ: Can I track costs per conversation?\nA: Not directly. Costs are tracked per session. Use sessions_list to see per-session token counts.\n\nQ: Works with non-Anthropic models?\nA: Yes. Token counts work for all providers. Cost estimation requires known pricing (add custom rates in the cost reference section)."
      },
      {
        "title": "v1.1.0",
        "body": "Generalized all agent names in examples\nNo specific setup references"
      },
      {
        "title": "v1.0.0",
        "body": "Initial release"
      }
    ],
    "body": "Agent Cost Monitor — Know What Your Agents Cost\n\nTrack token usage, costs, and efficiency across all your OpenClaw agents in real-time. Get alerts before you blow your budget.\n\nThe Problem\n\nRunning multiple agents is powerful — but expensive if you're not watching:\n\nWhich agent is burning the most tokens?\nAre heartbeats wasting money on expensive models?\nIs caching actually saving you anything?\nWhen will you hit your weekly rate limit?\nWhat This Skill Does\n\nWhen triggered (via cron or manually), the agent:\n\nChecks session_status for each agent\nCalculates per-agent and total costs\nCompares against budget thresholds\nSends alerts if limits are approaching\nSuggests optimization moves\nUsage\n\nAsk your monitoring agent (or any agent with this skill):\n\n\"Give me a cost report for all agents\"\n\"Which agent used the most tokens today?\"\n\"Am I going to hit my rate limit this week?\"\n\nAutomated Daily Report (Cron)\n{\n  \"name\": \"Daily Cost Report\",\n  \"schedule\": { \"kind\": \"cron\", \"expr\": \"0 20 * * *\", \"tz\": \"Europe/Berlin\" },\n  \"payload\": {\n    \"kind\": \"agentTurn\",\n    \"message\": \"Run a cost report across all agents. Check session_status for each. Report: total tokens, cost per agent, top spender, budget warnings. Send summary to user.\"\n  },\n  \"sessionTarget\": \"isolated\",\n  \"delivery\": { \"mode\": \"announce\" }\n}\n\nCost Report Format\n\nWhen generating a report, use this structure:\n\n## 💰 Agent Cost Report — [Date]\n\n### Per-Agent Breakdown\n| Agent | Model | Tokens (24h) | Est. Cost | Status |\n|-------|-------|-------------|-----------|--------|\n| Central | Opus 4.6 | 125K | $1.87 | ⚠️ High |\n| Techops | Opus 4.6 | 89K | $1.33 | ✅ Normal |\n| Atlas | Sonnet 4.5 | 45K | $0.27 | ✅ Low |\n| Closer | Haiku 4.5 | 23K | $0.02 | ✅ Minimal |\n| Heartbeats | Ollama | 12K | $0.00 | ✅ Free |\n\n### Summary\n- **Total 24h:** 294K tokens (~$3.49)\n- **Projected weekly:** ~$24.43\n- **Budget:** $20/week → ⚠️ 122% projected\n\n### Recommendations\n1. Move Techops from Opus → Sonnet for routine tasks (-40% cost)\n2. Increase heartbeat interval from 15m → 30m\n3. Enable context pruning on Atlas (idle sessions burning cache)\n\nModel Cost Reference\n\nUse these rates for estimation (as of 2026):\n\nAnthropic (Claude OAuth / API)\nModel\tInput/1M\tOutput/1M\tCache Read/1M\tCache Write/1M\nOpus 4.6\t$5.00\t$25.00\t$0.50\t$6.25\nSonnet 4.5\t$3.00\t$15.00\t$0.30\t$3.75\nHaiku 4.5\t$1.00\t$5.00\t$0.08\t$1.25\nFree Options\nModel\tCost\tUse For\nOllama (local)\t$0\tHeartbeats, simple tasks\nGemini OAuth\t$0*\tFallback (rate limited)\n\n*Free tier with rate limits\n\nOptimization Playbook\nQuick Wins (Do These First)\nHeartbeats on Ollama\n{ \"heartbeat\": { \"model\": \"ollama/llama3.2:3b\" } }\n\n\nSaves: 100% of heartbeat costs (can be $5-10/week with Opus)\n\nHaiku Cache Retention Off\n{ \"anthropic/claude-haiku-4-5\": { \"params\": { \"cacheRetention\": \"none\" } } }\n\n\nSaves: Cache write costs on cheap model (not worth caching)\n\nContext Pruning\n{ \"contextPruning\": { \"mode\": \"cache-ttl\", \"ttl\": \"5m\" } }\n\n\nSaves: Stale context re-reads on every turn\n\nOpus/Sonnet Cache Retention Long\n{ \"anthropic/claude-opus-4-6\": { \"params\": { \"cacheRetention\": \"long\" } } }\n\n\nSaves: Re-sending system prompt every turn (biggest single saving)\n\nModel Tiering (Biggest Impact)\nTask Type\tUse This\tNot This\tSaving\nCoordination, complex reasoning\tOpus\t—\tJustified\nFinance, data analysis\tSonnet\tOpus\t-40%\nSales drafts, marketing copy\tHaiku\tSonnet\t-67%\nHeartbeats, health checks\tOllama\tAny paid\t-100%\nTweet drafts\tHaiku or Grok\tOpus\t-80%\nSession Management\nDaily reset: Sessions auto-clear at a set hour (reduces token accumulation)\n{ \"session\": { \"reset\": { \"mode\": \"daily\", \"atHour\": 4, \"idleMinutes\": 45 } } }\n\nMemory flush: Save important context before compaction\n{ \"compaction\": { \"memoryFlush\": { \"enabled\": true } } }\n\nAlert Thresholds\n\nConfigure in your monitoring agent's memory:\n\n## Budget Alerts\n- Daily budget: $5.00 (warn at 80% = $4.00)\n- Weekly budget: $20.00 (warn at 70% = $14.00)\n- Per-agent daily max: $2.00\n- Alert channel: Telegram DM\n\nIntegration with DevOps Agent\n\nIf you have a DevOps/monitoring agent (e.g. your DevOps agent), add to its AGENTS.md:\n\n## Cost Monitoring\n- Run daily cost report at 20:00\n- Alert if any agent exceeds $2/day\n- Weekly summary every Monday 09:00\n- Track trends: is usage going up or down?\n\nFAQ\n\nQ: Does this skill make API calls? A: No. It uses OpenClaw's built-in session_status tool. No external APIs, no additional costs.\n\nQ: How accurate are cost estimates? A: Based on published model pricing. Actual costs may vary with caching hits. Estimates are conservative (slightly high).\n\nQ: Can I track costs per conversation? A: Not directly. Costs are tracked per session. Use sessions_list to see per-session token counts.\n\nQ: Works with non-Anthropic models? A: Yes. Token counts work for all providers. Cost estimation requires known pricing (add custom rates in the cost reference section).\n\nChangelog\nv1.1.0\nGeneralized all agent names in examples\nNo specific setup references\nv1.0.0\nInitial release"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/neal-collab/agent-cost-monitor",
    "publisherUrl": "https://clawhub.ai/neal-collab/agent-cost-monitor",
    "owner": "neal-collab",
    "version": "1.1.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-cost-monitor",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-cost-monitor",
    "agentUrl": "https://openagent3.xyz/skills/agent-cost-monitor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-cost-monitor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-cost-monitor/agent.md"
  }
}