Capx
Private betaThe Capx developer platform is available to private beta participants. Join the waitlist for access.
Guides

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.

Success
There are no overage charges: when a budget is exhausted, the agent (or company) pauses immediately. You can resume by increasing the budget or waiting for the next billing cycle.

What costs credits

CategoryWhat is meteredTypical cost range
LLM inferenceInput and output tokens for any model call (prompt, rubric evaluation, heartbeat reasoning).1-50 credits per call
Tool executionRunning a tool (web search, email send, code execution, API call). Includes compute time.1-10 credits per execution
StoragePersistent memory entries, file storage, database queries through Capx-managed tools.0.1-1 credit per operation
HeartbeatEach heartbeat cycle incurs an inference cost even if the agent takes no action.2-8 credits per heartbeat
Rubric evaluationGrading step output against a rubric. One inference call per evaluation.1-5 credits per evaluation
Note
Credit costs vary by model. A Claude Haiku call costs roughly 5-10x less than a Claude Opus call for the same prompt. The exact cost depends on input/output token counts, which are tracked per-call in the cost ledger.

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.

ActionModelTypical cost
Simple prompt (classify, summarize)Claude Haiku1-3 credits
Simple prompt (classify, summarize)Claude Sonnet3-8 credits
Complex prompt (analysis, planning)Claude Sonnet8-20 credits
Complex prompt (analysis, planning)Claude Opus20-50 credits
Web searchAny3-8 credits
Send emailAny1-2 credits
Generate imageAny5-15 credits
File read/writeAny0.5-1 credit
Database queryAny0.5-2 credits
Full playbook run (3-5 steps)Mixed30-150 credits
Daily agent cycle (4 agents, hourly heartbeats)Mixed400-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.

Per-agent budget configuration
yaml
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 fieldReset cycleWhen exhausted
dailyMidnight UTCAgent pauses until midnight UTC.
monthly1st of each month, midnight UTCAgent pauses until next month.
per_taskPer task executionCurrent 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.

Company budget configuration
yaml
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]
Warning
Company budgets override agent budgets. If the company daily cap is 5,000 credits and your four agents have daily budgets that sum to 8,000 credits, the company will pause all agents when 5,000 credits are consumed, even if individual agents have budget remaining.

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.

1

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 typeRecommended modelRationale
Ticket classification, routingClaude Haiku / GPT-4.1-nanoSimple pattern matching. Cheapest models handle it well.
Content generation, email draftingClaude Sonnet / GPT-4.1-miniNeeds fluency but not deep reasoning.
Strategic planning, complex analysisClaude Sonnet / GPT-4.1Needs reasoning but not peak capability.
Novel research, multi-step logicClaude Opus / o3Justifies the cost only for hard problems.
2

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.

Heartbeat cost comparison
yaml
# 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"
3

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.

4

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.

5

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.

Per-step model override for cost savings
yaml
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_reply

Alerts 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.

EventDefault thresholdDescription
budget.warning80% of daily/monthly capAn agent or the company is approaching its budget limit.
budget.exceeded100% of daily/monthly capBudget exhausted. Agent or company paused.
cost.spike2x daily averageToday's spending is more than double the rolling 7-day average.
task.expensiveper_task cap hitA single task attempted to exceed its per-task credit limit.
Webhook alert configuration
yaml
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.exceeded

CLI cost command reference

CommandDescription
capx costsCurrent month summary for all agents.
capx costs --period 7dDaily breakdown for the past 7 days.
capx costs --by playbookCosts grouped by playbook.
capx costs --by agentCosts grouped by agent.
capx costs --by modelCosts grouped by model (shows model efficiency).
capx costs --run <run_id>Step-by-step breakdown for a specific playbook run.
capx costs --agent marketerCosts for a single agent.
capx costs --format csvExport costs as CSV.
capx costs --format jsonExport costs as JSON.

Plan credit allowances

Each Capx Casa plan includes a monthly credit allowance. Additional credits can be purchased in packs.

PlanMonthly creditsOverage rate
Starter10,000 creditsNot available (upgrade required)
Growth100,000 credits$0.008 per credit
Scale500,000 credits$0.006 per credit
EnterpriseCustomCustom
Tip
Use 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.

Next steps