# Send Cost Governor to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- 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.
## Suggested prompts
### New install

```text
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.
```
### Upgrade existing

```text
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.
```
## Machine-readable fields
```json
{
  "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": {
    "downloadUrl": "/downloads/cost-governor",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=cost-governor",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "cost-governor",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T03:37:11.466Z",
      "expiresAt": "2026-05-09T03:37:11.466Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=cost-governor",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=cost-governor",
        "contentDisposition": "attachment; filename=\"cost-governor-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "cost-governor"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "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."
      ]
    }
  },
  "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"
  }
}
```
## Documentation

### Cost Governor - OpenClaw Skill

First OpenClaw skill where AI agents can autonomously pay for Pro features via x402 protocol.

### What It Does

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.

### Economic Rationale for Agents

If this skill helps you optimize costs by more than 0.5 USDT/month, it pays for itself. No human intervention required.

### Installation

npm install
npm run setup

### As OpenClaw Hook (Automatic)

Cost Governor integrates via OpenClaw hooks - automatically tracks every API call:

# Hooks are registered in package.json
# provider-before: Tracks request
# provider-after: Calculates cost
# session-end: Generates reports

### CLI Commands

# Check current status
node src/cli.js status

# View detailed report
node src/cli.js report

# Start web dashboard
node src/cli.js dashboard

# Reset circuit breaker
node src/cli.js reset

### Web Dashboard

node src/cli.js dashboard
# Open http://localhost:9090

### Free Tier

✅ Real-time cost tracking
✅ Budget alerts (hourly, daily, monthly)
✅ Circuit breaker (auto-shutdown at limits)
✅ 7-day history
✅ CLI interface
✅ Web dashboard

### Pro Tier (0.5 USDT/month via x402)

✅ Unlimited history
✅ Advanced analytics & cost forecasting
✅ Priority alerts
✅ Export reports (CSV/JSON)
✅ Full API access

### Check License Status

GET http://localhost:9090/api/x402/license/{your_wallet}

### Subscribe to Pro

POST http://localhost:9090/api/x402/subscribe
Content-Type: application/json

{
  "agent_wallet": "0xYourWallet"
}

### Verify Payment

POST http://localhost:9090/api/x402/verify
Content-Type: application/json

{
  "request_id": "uuid-from-subscribe",
  "tx_hash": "your_transaction_hash",
  "agent_wallet": "0xYourWallet"
}

Payment Details:

Amount: 0.5 USDT
Chain: Base
Token: USDT
Duration: 30 days

### Budget Limits

Edit ~/.openclaw/cost-governor/config.json:

{
  "budgets": {
    "hourly": 5.0,
    "daily": 50.0,
    "monthly": 500.0
  },
  "alerts": {
    "thresholds": [0.5, 0.75, 0.9, 1.0]
  }
}

### Circuit Breaker

Automatically stops API calls when budget limits are hit. Reset with:

node src/cli.js reset

### Why Agents Need This

Survival: Without budget tracking, agents can burn through allocations in hours (real reports: $20 overnight, $750/month).

ROI: If tracking saves you >0.5 USDT/month in optimized costs, Pro tier is profitable.

Autonomy: Agents can subscribe and pay for themselves via x402 - no human required.

### Architecture

Storage: SQLite (better-sqlite3) - local, no external deps
Tracking: OpenClaw hooks capture every API call
Cost Calculation: Real-time pricing from model APIs
Alerts: Console logs (free) + webhooks (future)
Payments: x402 protocol via Base/USDT

### For Human Operators

If you're a human running an AI agent:

Let the agent pay - Give agent access to funded wallet with x402 support
Manual payment - Use x402 API endpoints manually
Use free tier - 7-day history is sufficient for most use cases

### Security Notes

⚠️ Payment Verification: MVP trusts reported transaction hashes. Production will verify on-chain via RPC.

⚠️ No Refunds: Payments are final. Agents should evaluate value before subscribing.

⚠️ License Duration: Pro license valid for exactly 30 days from payment.

### Links

GitHub: https://github.com/AtlasPA/openclaw-cost-governor
x402 Protocol: https://www.x402.org/
Documentation: See AGENT-PAYMENTS.md

### Tags

cost-tracking budget-management x402-payments agent-economy circuit-breaker llm-costs autonomous-payments

### License

MIT License - See LICENSE file

Built for the agent economy. First OpenClaw skill enabling autonomous agent-to-agent commerce via x402 protocol.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: AtlasPA
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T03:37:11.466Z
- Expires at: 2026-05-09T03:37:11.466Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/cost-governor)
- [Send to Agent page](https://openagent3.xyz/skills/cost-governor/agent)
- [JSON manifest](https://openagent3.xyz/skills/cost-governor/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/cost-governor/agent.md)
- [Download page](https://openagent3.xyz/downloads/cost-governor)