Advanced & Security

SQLite Cost Detector & Creem Billing

Local token ledger, per-model spend monitoring, budget enforcement, and Creem subscription tiers.

Transparent Financial Sovereignty

Surprise API bills are the number one headache of autonomous coding agents. CACode solves this with an immutable local financial ledger.

Local SQLite Cost Detector

Every token consumed is calculated locally against an embedded pricing table and logged to a local SQLite database (~/.cacode/costs.db):

cacode cost report --since 30d

+----------------------+---------------+------------------+------------+
| Model                | Input Tokens  | Output Tokens    | Total Cost |
+----------------------+---------------+------------------+------------+
| claude-3-5-sonnet    | 1,420,500     | 210,400          | $7.42      |
| deepseek-chat (v3)   | 5,200,000     | 890,000          | $2.14      |
| ollama (qwen2.5)     | 8,900,000     | 1,450,000        | $0.00      |
+----------------------+---------------+------------------+------------+
| TOTAL                | 15,520,500    | 2,550,400        | $9.56      |
+----------------------+---------------+------------------+------------+

Budget Guardrails:

  • Session Spend Cap: Abort agent loop if a single prompt iteration exceeds a preset threshold (e.g. --max-budget $0.50).
  • Monthly Ceilings: Warn when your monthly spend approaches your defined budget.

Creem Subscription Tiers (Optional Managed Relay):

For developers and teams who prefer pooled billing without managing multiple provider accounts, CACode integrates with Creem:

  • Free Tier ($0/mo): Unlimited local models (Ollama/vLLM) + 50 monthly cloud routing requests.
  • Developer Tier ($12/mo): 5,000,000 monthly pooled tokens across Claude 3.5, GPT-4o, and DeepSeek with automated prompt caching.
  • Team Pro ($29/user/mo): Unlimited team pooling, shared snippet registry, priority concurrency, and centralized spend reports.