Act 3 Scaling — Operations 18 min read March 2026

Cost Control: Your AI Workforce Budget

The compute is cheap. 50 AI agents running 4 hours/day costs $120/month in sandbox compute. The model costs (Claude, GPT) are 10x that. This guide covers per-agent tracking, per-department budgets, auto-stop, hard spending caps, and the monthly cost report you send to finance.

Anatomy of an AI agent's costs

Every AI agent task has two cost components: compute (the sandbox, browser containers, GPU time) and model inference (Claude, GPT, or other LLM API calls). Understanding the ratio is critical for budgeting.

ComponentWhat it coversTypical costYou control it via
ComputeSandbox VMs, browser containers, desktop containers, GPU instances$0.001–0.50 per taskInstance type, auto-stop, idle timeout
Model inferenceClaude/GPT API calls for reasoning, vision, code generation$0.01–5.00 per taskModel choice (Sonnet vs Opus), prompt length, number of steps
Compute is 10–20% of total cost. Model inference is 80–90%.

A typical task costs $0.02 in sandbox compute and $0.15 in Claude API calls. Optimizing compute (smaller instances, shorter runtimes) saves pennies. Optimizing model usage (Sonnet instead of Opus, fewer vision steps, shorter prompts) saves dollars. Focus your cost optimization on the model layer.

Per-task cost tracking

Tag every sandbox and container with a run_id, task_type, and department in the metadata field. The platform tracks compute costs per container automatically. Combine with your model provider's usage data to get full per-task costs.

bash
# Tag every resource with cost allocation metadata
curl -s -X POST "$SANDBOX_URL/api/sandboxes" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "weekly-ap-run",
    "instance_type": "ab0t.micro",
    "auto_stop_minutes": 15,
    "metadata": {
      "department": "finance",
      "task_type": "accounts-payable",
      "run_id": "ap-2026-03-27",
      "cost_center": "CC-4200"
    }
  }'
bash — query costs per user or organization
# Get cost report for a user
curl -s "$SANDBOX_URL/api/costs/user/$USER_ID" \
  -H "Authorization: Bearer $API_KEY" | jq .

# Get organization-wide costs
curl -s "$SANDBOX_URL/api/costs/organization" \
  -H "Authorization: Bearer $API_KEY" | jq .

# Check quota usage
curl -s "$SANDBOX_URL/api/quotas/usage" \
  -H "Authorization: Bearer $API_KEY" | jq .

Auto-stop: the #1 cost control lever

The single most effective cost control is auto_stop_minutes. Set it on every sandbox. When the sandbox is idle (no active SSH session, no running commands) for longer than the timeout, it stops automatically. Billing pauses. Files persist.

Task typeRecommended auto_stopWhy
Event-driven (PR review, webhook)10–15 minTask completes quickly; stop fast if cleanup fails
Interactive session (Claude Code)60–120 minAgent may pause between tasks; don't kill mid-thought
Overnight batch job0 (disabled) or 240 minLong-running; but set a ceiling for safety
Persistent / always-on120–240 minCatches forgotten sandboxes; agent can restart when needed
The #1 cause of unexpected bills

A sandbox created with auto_stop_minutes: 0 (never auto-stop) that nobody remembers to stop. A ab0t.medium running 24/7 for a month costs $30. Set auto-stop on everything. Even persistent sandboxes should have a 4-hour timeout as a safety net.

Hard spending caps

Set monthly cost limits per user or per organization. When the limit is reached, new sandbox creation is blocked and the API returns a 402 (Payment Required) response. Existing sandboxes continue running until they auto-stop.

bash
# Set a $50/month limit for a user
curl -s -X POST "$SANDBOX_URL/api/costs/limits/user/$USER_ID" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"monthly_limit": 50.00}'

# Check remaining budget before creating a sandbox
curl -s "$SANDBOX_URL/api/quotas/check/sandboxes" \
  -H "Authorization: Bearer $API_KEY" | jq .

Right-sizing instances

Most tasks don't need a ab0t.medium. Here's the decision matrix:

InstanceSpecsCost/hourBest for
ab0t.micro2 vCPU, 1 GB$0.0104Orchestration, light scripts, API calls, small data processing
ab0t.small2 vCPU, 2 GB$0.0208npm install, medium datasets, test suites
ab0t.medium2 vCPU, 4 GB$0.0416Large codebases, heavy builds, pandas on >100MB files
ab0t.large2 vCPU, 8 GB$0.0832Java builds, large test suites, memory-heavy processing
ab0t.gpu4 vCPU, 16 GB, T4 GPU$0.526ML inference only — stop immediately after job completes
Default to ab0t.micro

If you're not sure which instance to use, start with ab0t.micro. If the task runs out of memory (the sandbox gets killed), retry on ab0t.small. Most orchestration, API calls, and light data processing runs fine on 1 GB RAM. Only upgrade when you hit a concrete limit.

Browser and desktop container costs

Browser and desktop containers run in the cloud. They're billed per-second at approximately $0.03/hour. The key cost controls:

Controlling model inference costs

Model costs dominate. Here's how to keep them in check:

Use Sonnet for everything except deep reasoning

Claude Sonnet 4.6 costs ~3x less than Opus 4.6 per token and is fast enough for 95% of agent tasks: code review, data extraction, vision analysis, report generation. Reserve Opus for tasks that require deep multi-step reasoning or architectural decisions.

Minimize vision calls

Each screenshot sent to Claude's vision model costs ~$0.005. For a QA run with 30 screenshots, that's $0.15. For a competitive intel sweep with 60 screenshots and 60 comparison pairs, it's $1.20. Optimize by only comparing pages that changed at the text layer first (free), then use vision only for pages with detected text changes.

Cap output tokens

Set max_tokens explicitly on every API call. An extraction task that needs 200 tokens of structured JSON doesn't need a 4096-token budget. Lower limits mean lower costs and faster responses.

Batch where possible

Instead of 50 separate Claude calls (one per competitor page), batch extracted text from 5 pages into a single call. Fewer calls = fewer overhead tokens = lower cost.

The monthly cost report

Pull cost data from the platform API and your model provider. Here's the report template your finance team wants:

markdown — monthly cost report
# AI Workforce Cost Report — March 2026

## Summary
| Category | Amount |
|----------|--------|
| Sandbox compute (EC2) | $18.40 |
| Browser containers (cloud) | $6.20 |
| Desktop containers (cloud) | $1.80 |
| GPU instances | $4.50 |
| **Compute subtotal** | **$30.90** |
| Claude API (Sonnet) | $142.00 |
| Claude API (Opus) | $38.00 |
| **Model subtotal** | **$180.00** |
| **Total** | **$210.90** |

## By department
| Department | Compute | Model | Total | Tasks |
|------------|---------|-------|-------|-------|
| Engineering (PR review, QA) | $12.40 | $85.00 | $97.40 | 520 |
| Finance (AP, reconciliation) | $4.20 | $32.00 | $36.20 | 52 |
| Strategy (competitive intel) | $3.80 | $28.00 | $31.80 | 30 |
| Product (research, data) | $8.50 | $25.00 | $33.50 | 45 |
| Ops (desktop, monitoring) | $2.00 | $10.00 | $12.00 | 18 |

## Top 5 agents by cost
1. QA on deploy — $65.40 (100 deploys × $0.15 compute + model)
2. PR reviewer — $48.20 (100 PRs × $0.05 compute + model)
3. Competitive intel — $31.80 (30 daily runs)
4. Monthly data pipeline — $18.50 (4 reconciliation runs + ad-hoc)
5. AP vendor portals — $12.40 (4 weekly runs)

## vs human cost equivalent
| Agent | Monthly AI cost | Human equivalent | Savings |
|-------|----------------|-----------------|---------|
| QA on deploy | $65.40 | $8,300 (QA engineer) | 99.2% |
| PR reviewer | $48.20 | $2,500 (1 hr/day senior eng) | 98.1% |
| Competitive intel | $31.80 | $2,000 (part-time analyst) | 98.4% |
| AP vendor portals | $12.40 | $1,500 (AP clerk time) | 99.2% |
| **Total** | **$210.90** | **$14,300** | **98.5%** |

The math: 50 AI agents at scale

$120
Compute/month (50 agents, 4 hrs/day)
$1,200
Model costs/month (estimated)
$1,320
Total monthly AI workforce

50 AI agents, each running 4 hours/day on ab0t.micro instances, processing tasks that use Claude Sonnet for reasoning. The compute is $120/month. The model inference (assuming ~100 API calls/day across all agents at ~$0.40/day) is ~$1,200/month. Total: $1,320/month for 50 AI employees.

The human equivalent for the same work: 5–10 FTEs at $5,000–12,000/month each = $25,000–120,000/month. The AI workforce costs 1–5% of the human cost.

Cost optimization checklist

  1. Set auto_stop_minutes on every sandbox. No exceptions. Default to 15 for event-driven, 120 for interactive.
  2. Default to ab0t.micro. Upgrade only when you hit memory limits.
  3. Use Sonnet, not Opus. Save Opus for tasks that demonstrably produce better results.
  4. Release browser containers, don't delete them. Warm pool reuse saves cold-start costs.
  5. Set idle_timeout_minutes on all containers. 10–15 min for browsers, 30 min for desktops.
  6. Tag everything with department and task_type. You can't optimize what you can't measure.
  7. Set spending caps per user. Prevents runaway costs from misconfigured agents.
  8. Review the monthly report. Identify which agents cost the most and whether they're providing proportional value.
  9. Stop GPU instances immediately after inference. A forgotten ab0t.gpu costs $12.62/day.
  10. Batch model calls where possible. 1 call with 5 pages of context < 5 calls with 1 page each.

What's next

50 AI employees. $1,320/month.

Per-agent tracking. Per-department budgets. Auto-stop. Spending caps. The AI workforce that finance approves.

Get Started Free