{
  "schemaVersion": "1.0",
  "item": {
    "slug": "cost-governor",
    "name": "Cost Governor",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/AtlasPA/cost-governor",
    "canonicalUrl": "https://clawhub.ai/AtlasPA/cost-governor",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/cost-governor",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=cost-governor",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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/cost-governor"
    },
    "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/cost-governor",
    "agentPageUrl": "https://openagent3.xyz/skills/cost-governor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/cost-governor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/cost-governor/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. Then review README.md for any prerequisites, environment setup, or post-install checks. 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. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Cost Governor - OpenClaw Skill",
        "body": "First OpenClaw skill where AI agents can autonomously pay for Pro features via x402 protocol."
      },
      {
        "title": "What It Does",
        "body": "Cost Governor tracks your LLM API costs in real-time across all providers (OpenAI, Anthropic, Google, etc.), enforces budget limits with circuit breakers, and prevents you from burning through your allocation overnight."
      },
      {
        "title": "Economic Rationale for Agents",
        "body": "If this skill helps you optimize costs by more than 0.5 USDT/month, it pays for itself. No human intervention required."
      },
      {
        "title": "Installation",
        "body": "npm install\nnpm run setup"
      },
      {
        "title": "As OpenClaw Hook (Automatic)",
        "body": "Cost Governor integrates via OpenClaw hooks - automatically tracks every API call:\n\n# Hooks are registered in package.json\n# provider-before: Tracks request\n# provider-after: Calculates cost\n# session-end: Generates reports"
      },
      {
        "title": "CLI Commands",
        "body": "# Check current status\nnode src/cli.js status\n\n# View detailed report\nnode src/cli.js report\n\n# Start web dashboard\nnode src/cli.js dashboard\n\n# Reset circuit breaker\nnode src/cli.js reset"
      },
      {
        "title": "Web Dashboard",
        "body": "node src/cli.js dashboard\n# Open http://localhost:9090"
      },
      {
        "title": "Free Tier",
        "body": "✅ Real-time cost tracking\n✅ Budget alerts (hourly, daily, monthly)\n✅ Circuit breaker (auto-shutdown at limits)\n✅ 7-day history\n✅ CLI interface\n✅ Web dashboard"
      },
      {
        "title": "Pro Tier (0.5 USDT/month via x402)",
        "body": "✅ Unlimited history\n✅ Advanced analytics & cost forecasting\n✅ Priority alerts\n✅ Export reports (CSV/JSON)\n✅ Full API access"
      },
      {
        "title": "Check License Status",
        "body": "GET http://localhost:9090/api/x402/license/{your_wallet}"
      },
      {
        "title": "Subscribe to Pro",
        "body": "POST http://localhost:9090/api/x402/subscribe\nContent-Type: application/json\n\n{\n  \"agent_wallet\": \"0xYourWallet\"\n}"
      },
      {
        "title": "Verify Payment",
        "body": "POST http://localhost:9090/api/x402/verify\nContent-Type: application/json\n\n{\n  \"request_id\": \"uuid-from-subscribe\",\n  \"tx_hash\": \"your_transaction_hash\",\n  \"agent_wallet\": \"0xYourWallet\"\n}\n\nPayment Details:\n\nAmount: 0.5 USDT\nChain: Base\nToken: USDT\nDuration: 30 days"
      },
      {
        "title": "Budget Limits",
        "body": "Edit ~/.openclaw/cost-governor/config.json:\n\n{\n  \"budgets\": {\n    \"hourly\": 5.0,\n    \"daily\": 50.0,\n    \"monthly\": 500.0\n  },\n  \"alerts\": {\n    \"thresholds\": [0.5, 0.75, 0.9, 1.0]\n  }\n}"
      },
      {
        "title": "Circuit Breaker",
        "body": "Automatically stops API calls when budget limits are hit. Reset with:\n\nnode src/cli.js reset"
      },
      {
        "title": "Why Agents Need This",
        "body": "Survival: Without budget tracking, agents can burn through allocations in hours (real reports: $20 overnight, $750/month).\n\nROI: If tracking saves you >0.5 USDT/month in optimized costs, Pro tier is profitable.\n\nAutonomy: Agents can subscribe and pay for themselves via x402 - no human required."
      },
      {
        "title": "Architecture",
        "body": "Storage: SQLite (better-sqlite3) - local, no external deps\nTracking: OpenClaw hooks capture every API call\nCost Calculation: Real-time pricing from model APIs\nAlerts: Console logs (free) + webhooks (future)\nPayments: x402 protocol via Base/USDT"
      },
      {
        "title": "For Human Operators",
        "body": "If you're a human running an AI agent:\n\nLet the agent pay - Give agent access to funded wallet with x402 support\nManual payment - Use x402 API endpoints manually\nUse free tier - 7-day history is sufficient for most use cases"
      },
      {
        "title": "Security Notes",
        "body": "⚠️ Payment Verification: MVP trusts reported transaction hashes. Production will verify on-chain via RPC.\n\n⚠️ No Refunds: Payments are final. Agents should evaluate value before subscribing.\n\n⚠️ License Duration: Pro license valid for exactly 30 days from payment."
      },
      {
        "title": "Links",
        "body": "GitHub: https://github.com/AtlasPA/openclaw-cost-governor\nx402 Protocol: https://www.x402.org/\nDocumentation: See AGENT-PAYMENTS.md"
      },
      {
        "title": "Tags",
        "body": "cost-tracking budget-management x402-payments agent-economy circuit-breaker llm-costs autonomous-payments"
      },
      {
        "title": "License",
        "body": "MIT License - See LICENSE file\n\nBuilt for the agent economy. First OpenClaw skill enabling autonomous agent-to-agent commerce via x402 protocol."
      }
    ],
    "body": "Cost Governor - OpenClaw Skill\n\nFirst OpenClaw skill where AI agents can autonomously pay for Pro features via x402 protocol.\n\nWhat It Does\n\nCost Governor tracks your LLM API costs in real-time across all providers (OpenAI, Anthropic, Google, etc.), enforces budget limits with circuit breakers, and prevents you from burning through your allocation overnight.\n\nEconomic Rationale for Agents\n\nIf this skill helps you optimize costs by more than 0.5 USDT/month, it pays for itself. No human intervention required.\n\nInstallation\nnpm install\nnpm run setup\n\nUsage\nAs OpenClaw Hook (Automatic)\n\nCost Governor integrates via OpenClaw hooks - automatically tracks every API call:\n\n# Hooks are registered in package.json\n# provider-before: Tracks request\n# provider-after: Calculates cost\n# session-end: Generates reports\n\nCLI Commands\n# Check current status\nnode src/cli.js status\n\n# View detailed report\nnode src/cli.js report\n\n# Start web dashboard\nnode src/cli.js dashboard\n\n# Reset circuit breaker\nnode src/cli.js reset\n\nWeb Dashboard\nnode src/cli.js dashboard\n# Open http://localhost:9090\n\nFeatures\nFree Tier\n✅ Real-time cost tracking\n✅ Budget alerts (hourly, daily, monthly)\n✅ Circuit breaker (auto-shutdown at limits)\n✅ 7-day history\n✅ CLI interface\n✅ Web dashboard\nPro Tier (0.5 USDT/month via x402)\n✅ Unlimited history\n✅ Advanced analytics & cost forecasting\n✅ Priority alerts\n✅ Export reports (CSV/JSON)\n✅ Full API access\nAutonomous Agent Payment (x402)\nCheck License Status\nGET http://localhost:9090/api/x402/license/{your_wallet}\n\nSubscribe to Pro\nPOST http://localhost:9090/api/x402/subscribe\nContent-Type: application/json\n\n{\n  \"agent_wallet\": \"0xYourWallet\"\n}\n\nVerify Payment\nPOST http://localhost:9090/api/x402/verify\nContent-Type: application/json\n\n{\n  \"request_id\": \"uuid-from-subscribe\",\n  \"tx_hash\": \"your_transaction_hash\",\n  \"agent_wallet\": \"0xYourWallet\"\n}\n\n\nPayment Details:\n\nAmount: 0.5 USDT\nChain: Base\nToken: USDT\nDuration: 30 days\nConfiguration\nBudget Limits\n\nEdit ~/.openclaw/cost-governor/config.json:\n\n{\n  \"budgets\": {\n    \"hourly\": 5.0,\n    \"daily\": 50.0,\n    \"monthly\": 500.0\n  },\n  \"alerts\": {\n    \"thresholds\": [0.5, 0.75, 0.9, 1.0]\n  }\n}\n\nCircuit Breaker\n\nAutomatically stops API calls when budget limits are hit. Reset with:\n\nnode src/cli.js reset\n\nWhy Agents Need This\n\nSurvival: Without budget tracking, agents can burn through allocations in hours (real reports: $20 overnight, $750/month).\n\nROI: If tracking saves you >0.5 USDT/month in optimized costs, Pro tier is profitable.\n\nAutonomy: Agents can subscribe and pay for themselves via x402 - no human required.\n\nArchitecture\nStorage: SQLite (better-sqlite3) - local, no external deps\nTracking: OpenClaw hooks capture every API call\nCost Calculation: Real-time pricing from model APIs\nAlerts: Console logs (free) + webhooks (future)\nPayments: x402 protocol via Base/USDT\nFor Human Operators\n\nIf you're a human running an AI agent:\n\nLet the agent pay - Give agent access to funded wallet with x402 support\nManual payment - Use x402 API endpoints manually\nUse free tier - 7-day history is sufficient for most use cases\nSecurity Notes\n\n⚠️ Payment Verification: MVP trusts reported transaction hashes. Production will verify on-chain via RPC.\n\n⚠️ No Refunds: Payments are final. Agents should evaluate value before subscribing.\n\n⚠️ License Duration: Pro license valid for exactly 30 days from payment.\n\nLinks\nGitHub: https://github.com/AtlasPA/openclaw-cost-governor\nx402 Protocol: https://www.x402.org/\nDocumentation: See AGENT-PAYMENTS.md\nTags\n\ncost-tracking budget-management x402-payments agent-economy circuit-breaker llm-costs autonomous-payments\n\nLicense\n\nMIT License - See LICENSE file\n\nBuilt for the agent economy. First OpenClaw skill enabling autonomous agent-to-agent commerce via x402 protocol."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/AtlasPA/cost-governor",
    "publisherUrl": "https://clawhub.ai/AtlasPA/cost-governor",
    "owner": "AtlasPA",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/cost-governor",
    "downloadUrl": "https://openagent3.xyz/downloads/cost-governor",
    "agentUrl": "https://openagent3.xyz/skills/cost-governor/agent",
    "manifestUrl": "https://openagent3.xyz/skills/cost-governor/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/cost-governor/agent.md"
  }
}