Cost Control
How the credit system works, how to set budgets at every level, what counts as a credit, how to monitor spending in real time, and practical strategies for reducing costs without reducing output.
The credit system
Capx uses credits as the universal unit of compute. One credit is approximately $0.01 of underlying cost. Every billable action your agents take, including LLM inference, tool execution, and storage, is metered in credits. This abstraction lets you set budgets and compare costs across different models and providers without converting between token counts and pricing tiers.
Credits are deducted in real time as actions execute.
What costs credits
| Category | What is metered | Typical cost range |
|---|---|---|
| LLM inference | Input and output tokens for any model call (prompt, rubric evaluation, heartbeat reasoning). | 1-50 credits per call |
| Tool execution | Running a tool (web search, email send, code execution, API call). Includes compute time. | 1-10 credits per execution |
| Storage | Persistent memory entries, file storage, database queries through Capx-managed tools. | 0.1-1 credit per operation |
| Heartbeat | Each heartbeat cycle incurs an inference cost even if the agent takes no action. | 2-8 credits per heartbeat |
| Rubric evaluation | Grading step output against a rubric. One inference call per evaluation. | 1-5 credits per evaluation |
Cost reference table
The following table shows typical credit costs for common actions. Actual costs depend on prompt length, output length, and the model used.
| Action | Model | Typical cost |
|---|---|---|
| Simple prompt (classify, summarize) | Claude Haiku | 1-3 credits |
| Simple prompt (classify, summarize) | Claude Sonnet | 3-8 credits |
| Complex prompt (analysis, planning) | Claude Sonnet | 8-20 credits |
| Complex prompt (analysis, planning) | Claude Opus | 20-50 credits |
| Web search | Any | 3-8 credits |
| Send email | Any | 1-2 credits |
| Generate image | Any | 5-15 credits |
| File read/write | Any | 0.5-1 credit |
| Database query | Any | 0.5-2 credits |
| Full playbook run (3-5 steps) | Mixed | 30-150 credits |
| Daily agent cycle (4 agents, hourly heartbeats) | Mixed | 400-1,500 credits |
Per-agent budgets
Every agent has its own credit budget, defined in the budget block of its configuration in company.yaml. Per-agent budgets let you allocate more resources to high-value agents (like your strategist) and constrain low-priority ones.
agents:
strategist:
role: strategist
adapter:
provider: claude
model: claude-sonnet-4
budget:
daily: 1500 # Max 1,500 credits per day
monthly: 30000 # Max 30,000 credits per month
per_task: 300 # Max 300 credits for a single task
alert_threshold: 0.8 # Alert founder at 80% usage| Budget field | Reset cycle | When exhausted |
|---|---|---|
| daily | Midnight UTC | Agent pauses until midnight UTC. |
| monthly | 1st of each month, midnight UTC | Agent pauses until next month. |
| per_task | Per task execution | Current task pauses. Founder notified to approve or increase. |
Per-company budgets
Company-level budgets are an outer boundary. Even if every agent has budget remaining, the company budget can pause all activity. This prevents a scenario where five agents each spend their full daily allocation and the total exceeds what you intended.
governance:
spend_caps:
daily: 5000 # Max 5,000 credits/day total
monthly: 80000 # Max 80,000 credits/month total
per_action: 500 # No single action can exceed 500 credits
alert_thresholds:
- at: 0.5
notify: dashboard
- at: 0.8
notify: [dashboard, email]
- at: 0.95
notify: [dashboard, email, sms]Cost monitoring
Capx provides multiple ways to monitor costs:
- CLI: the fastest way to check current spending from a terminal.
- REST API: query cost data programmatically.
- Casa dashboard: monitor spending from the browser.
CLI cost commands
capx costs --company my-company # AGENT TODAY THIS WEEK THIS MONTH BUDGET REMAINING # strategist 142cr 1,018cr 4,240cr 30,000 25,760 # engineer 280cr 1,890cr 8,720cr 20,000 11,280 # marketer 38cr 285cr 1,150cr 15,000 13,850 # support 64cr 448cr 1,680cr 8,000 6,320 # TOTAL 524cr 3,641cr 15,790cr 80,000 64,210
API cost endpoints
# Current month summary curl https://api.capx.ai/v1/companies/my-company/costs \ -H "Authorization: Bearer capx_sk_live_..."
Cost optimization
The most effective way to reduce costs is to match model capability to task complexity. Here are the strategies that make the biggest difference, ranked by impact.
Right-size your models
This is the single highest-impact optimization. Use the cheapest model that can reliably pass the rubric for each task. A support triage agent running on Claude Haiku costs 5-10x less than the same agent on Claude Sonnet, and for simple classification tasks the quality difference is negligible.
| Task type | Recommended model | Rationale |
|---|---|---|
| Ticket classification, routing | Claude Haiku / GPT-4.1-nano | Simple pattern matching. Cheapest models handle it well. |
| Content generation, email drafting | Claude Sonnet / GPT-4.1-mini | Needs fluency but not deep reasoning. |
| Strategic planning, complex analysis | Claude Sonnet / GPT-4.1 | Needs reasoning but not peak capability. |
| Novel research, multi-step logic | Claude Opus / o3 | Justifies the cost only for hard problems. |
Reduce heartbeat frequency
Every heartbeat costs credits even when the agent has nothing to do. A strategist that wakes hourly costs 24x more in idle compute than one that wakes daily. Match heartbeat frequency to how quickly the agent needs to respond. Most agents do not need sub-hourly heartbeats.
# Expensive: 96 heartbeats/day at ~5 credits each = 480 credits/day idle heartbeat: cron: "*/15 * * * *" # Moderate: 24 heartbeats/day at ~5 credits each = 120 credits/day idle heartbeat: cron: "0 * * * *" # Efficient: 3 heartbeats/day at ~5 credits each = 15 credits/day idle heartbeat: cron: "0 9,13,17 * * 1-5"
Use rubrics to prevent waste
Rubrics cost one additional inference call per evaluation, but they prevent low-quality output from reaching expensive downstream steps. A 5-credit rubric evaluation that catches a bad draft before a 50-credit email-and-deploy sequence saves 45 credits per failure.
Optimize playbook design
Use capx costs --by playbook to identify your most expensive playbooks. Look for:
- Steps that can be combined.
- Conditions that can short-circuit execution.
- Prompts that can be shortened.
A playbook that runs 30 times a day at 50 credits per run costs 45,000 credits per month. A 20% efficiency gain saves 9,000 credits.
Use per-step model overrides
Instead of changing an agent's default model, override the model at the step level for specific tasks. Your marketer can use Sonnet for writing blog posts and Haiku for classifying inbound messages, all within the same playbook.
steps:
- id: classify
agent: marketer
adapter:
provider: claude
model: claude-haiku-4 # Cheap model for classification
tool: classify_messages
with:
source: inbox
- id: draft
agent: marketer
# Uses default adapter (claude-sonnet-4), a better model for writing
tool: generate_copy
with:
type: email_replyAlerts and notifications
Capx sends alerts when spending approaches or exceeds your configured thresholds. Alerts are delivered through the channels you specify: the Casa dashboard, email, SMS, or webhooks.
| Event | Default threshold | Description |
|---|---|---|
| budget.warning | 80% of daily/monthly cap | An agent or the company is approaching its budget limit. |
| budget.exceeded | 100% of daily/monthly cap | Budget exhausted. Agent or company paused. |
| cost.spike | 2x daily average | Today's spending is more than double the rolling 7-day average. |
| task.expensive | per_task cap hit | A single task attempted to exceed its per-task credit limit. |
governance:
alerts:
webhook:
url: "https://your-api.com/webhooks/capx-costs"
events:
- budget.warning
- budget.exceeded
- cost.spike
headers:
X-Webhook-Secret: "${{ secrets.WEBHOOK_SECRET }}"
email:
recipients:
- founder@example.com
events:
- budget.exceeded
- cost.spike
sms:
recipients:
- "+1234567890"
events:
- budget.exceededCLI cost command reference
| Command | Description |
|---|---|
| capx costs | Current month summary for all agents. |
| capx costs --period 7d | Daily breakdown for the past 7 days. |
| capx costs --by playbook | Costs grouped by playbook. |
| capx costs --by agent | Costs grouped by agent. |
| capx costs --by model | Costs grouped by model (shows model efficiency). |
| capx costs --run <run_id> | Step-by-step breakdown for a specific playbook run. |
| capx costs --agent marketer | Costs for a single agent. |
| capx costs --format csv | Export costs as CSV. |
| capx costs --format json | Export costs as JSON. |
Plan credit allowances
Each Capx Casa plan includes a monthly credit allowance. Additional credits can be purchased in packs.
| Plan | Monthly credits | Overage rate |
|---|---|---|
| Starter | 10,000 credits | Not available (upgrade required) |
| Growth | 100,000 credits | $0.008 per credit |
| Scale | 500,000 credits | $0.006 per credit |
| Enterprise | Custom | Custom |
capx costs --by model to see which models consume the most credits. This report often reveals that a single agent on an expensive model accounts for 60-70% of total spending. Switching that one agent to a more efficient model can cut your monthly bill dramatically.