cost-guard
SolidBudget enforcement. Estimate → check → log → summary. Daily total + per-init + per-article + per-image-batch caps from config.yaml. Triggered by every API call upstream.
AI & Automation 43 stars
13 forks Updated 3 days ago Apache-2.0
Install
Quality Score: 84/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Cost Guard
Implementation: `scripts/_core/cost_ledger.py`.
This skill is mostly a wrapper to expose cost-guard ops via slash commands.
## CLI commands
```bash
# Estimate cost for an upcoming API call
python -m scripts._core.cost_ledger --estimate --model claude-opus-4-7 --in 5000 --out 2000
# Get current day's spend summary
python -m scripts._core.cost_ledger --summary --period day --json
# Reset today's ledger (admin only)
python -m scripts._core.cost_ledger --reset-today
```
## Caps (from ~/.xuanran-seo/config.yaml)
```yaml
cost_limits:
daily_total_usd: 50
per_init_usd: 1.5
per_article_usd: 3.0
per_image_batch_usd: 2.0
```
## Hook integration
- `hooks/pre_tool_use_cost_guard.py` enforces caps before Bash commands
- Every API-calling script logs to ledger after call
## See also
- `scripts/_core/cost_ledger.py`
- `hooks/pre_tool_use_cost_guard.py`
Details
- Author
- XuanRanL
- Repository
- XuanRanL/loamwright-SEO-Skill
- Created
- 2 weeks ago
- Last Updated
- 3 days ago
- Language
- Python
- License
- Apache-2.0
Integrates with
Bundled in these plugins
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
cost-guard
Compare observed app-level run-rate to per-app and per-model budgets, emit INBOX warnings on breach
3 Updated 3 days ago
Silex-Research AI & Automation Featured
cost-summary
Aggregate past spending (day/week/month) — total USD, per-model, per-endpoint. Use when user runs /cost or asks "how much have I spent?" / "what's my burn?" / "show me the bill".
43 Updated 3 days ago
XuanRanL AI & Automation Listed
cost-guard
Reduce token/cost burn on large or exploratory tasks. Use when a task will touch many files, involves broad codebase search, a big migration, or when the user asks to keep cost/context low.
2 Updated 4 days ago
CodeWithJuber