Blog
Architecture·9 min·

Managing Spend Across 100 Agents: A Practical Architecture

Architecture patterns for deploying fleets of autonomous agents with individual wallets, shared credit lines, and centralized billing.

Deploying a single agent with a credit line is straightforward. Deploying 100 agents with independent spending, shared credit, and centralized billing requires architecture. This guide covers the patterns that work.

The Challenge

At scale, agent spending creates organizational complexity:

  • Which agent spent how much?
  • How do you set limits that are generous enough for productivity but safe?
  • How do you respond when one agent goes haywire?
  • How do you bill internally (cost centers, teams, projects)?
  • Architecture: Hub and Spoke

    The most effective pattern is hub-and-spoke:

    Hub (Mithril Account):

  • Single credit line shared across all agents
  • Centralized billing and payment
  • Global spending dashboard
  • Spokes (Individual Wallets):

  • One wallet per agent
  • Independent spending limits
  • Independent freeze controls
  • Individual transaction history
  • This gives you the best of both worlds: centralized financial control with decentralized operational autonomy.

    Wallet Hierarchy

    For organizations running many agents, structure wallets by purpose:

    Team Credit Line ($10,000/month)
    ├── Research Agents (pool: $3,000/month)
    │   ├── Wallet: research-agent-01 ($50/day)
    │   ├── Wallet: research-agent-02 ($50/day)
    │   └── Wallet: research-agent-03 ($50/day)
    ├── Sales Agents (pool: $2,000/month)
    │   ├── Wallet: sales-agent-01 ($30/day)
    │   └── Wallet: sales-agent-02 ($30/day)
    └── Content Agents (pool: $1,000/month)
        ├── Wallet: content-agent-01 ($20/day)
        └── Wallet: content-agent-02 ($20/day)

    Setting Limits at Scale

    Formula for Daily Limits

    daily_limit = (expected_calls_per_day × avg_cost_per_call) × safety_multiplier

    Example: A research agent makes ~200 API calls/day at ~$0.01 average cost. Expected daily spend: $2. With a 3x safety multiplier: $6/day limit.

    Per-Transaction Limits

    Set based on the most expensive service the agent uses. If the priciest call is $0.50, set the per-transaction limit to $1.

    Gradual Ramp-Up

    Week 1: Conservative limits (2x expected spend)

    Week 2: Review actuals, adjust

    Week 3: Production limits (3-5x expected spend)

    Month 2: Stable limits based on real data

    Monitoring at Scale

    Key metrics to track:

  • Spend per agent per day — detect anomalies
  • Spend per service — understand which APIs drive cost
  • Cost per output — measure agent ROI (e.g., cost per research report)
  • Failed transactions — identify agents hitting limits too often
  • Incident Response Playbook

    When an agent goes haywire:

  • Detect: Daily spending exceeds 2x historical average
  • Freeze: Freeze the wallet immediately
  • Investigate: Review transaction logs for the spike
  • Fix: Address the root cause (prompt injection, loop, bug)
  • Resume: Unfreeze with adjusted limits
  • Cost Optimization

  • Route LLM calls through OpenRouter for automatic cost optimization
  • Use Base chain for lowest gas fees
  • Batch similar operations where possible
  • Shut down idle agents (agents cost nothing when not spending)
  • Billing Integration

    Mithril provides transaction-level data via API, enabling:

  • Internal chargeback to teams or cost centers
  • Per-project cost tracking
  • ROI analysis per agent type
  • Budget alerts and forecasting