Skip to content

The Real Cost of Running AI Agents in Production: Self-Hosted vs Serverless vs Managed

An hourglass whose upper bulb is packed with tangled server infrastructure dissolving into glowing particles of time; below, a single serene agent cube floats on the pool of light

Everyone asks "how much does it cost to run an AI agent?" and every answer is vague. Here are the real numbers — AWS pricing, actual compute usage, and the hidden cost most comparisons miss: your time.

The agent workload

Let's model a typical AI agent:

  • Python, 512 MB memory, 5 minutes per run
  • Runs 4 times a day (every 6 hours)
  • Calls OpenAI GPT-4o (~2K tokens per run)
  • Needs API keys, logs, and monitoring

Option 1: Self-hosted (EC2 t3.nano)

Cost item Monthly
EC2 t3.nano (always on, 1-year reserved) $3.50
EBS 8 GB gp3 $0.64
Data transfer (~1 GB) $0.09
OpenAI API (~8K tokens/day) $0.60
Infrastructure subtotal $4.83
Your time: setup (~16 hours × $75/h) $1,200 (one-time)
Your time: maintenance (2h/month) $150

Month 1 total: $1,354.83. Month 2+: $154.83.

Option 2: Serverless (AWS Lambda + EventBridge)

Cost item Monthly
Lambda (512 MB, 5 min × 4/day = 20 min) $0.00 (free tier)
EventBridge (4 scheduled rules) $0.00 (free tier)
CloudWatch Logs (~1 GB) $0.50
Secrets Manager (3 secrets) $1.20
OpenAI API (~8K tokens/day) $0.60
Infrastructure subtotal $2.30
Your time: setup (~4 hours × $75/h) $300 (one-time)

Month 1 total: $302.30. Month 2+: $2.30.

Month-1 all-in — self-hosted
$1,355
$4.83 of infra + 16 h of setup
Month-1 all-in — serverless
$302
$2.30 of infra + 4 h of setup
Month-1 all-in — managed
$0
free tier, 5 minutes of setup

Option 3: Managed (HollowHost, Free tier)

Cost item Monthly
Platform (free tier: 12K tokens) $0.00
OpenAI API (included in free tokens) $0.00
IAM provisioning Included
Secrets management Included
Logging + dashboard Included
Cron scheduling Included
Infrastructure subtotal $0.00
Your time: setup (~5 minutes) $0

Month 1 total: $0. Month 2+: $0 (free tier) or $10 (Starter).

Self-hosted Serverless (Lambda) Managed (HollowHost) Month 1 — self-hosted: $1,355 Month 2 — self-hosted: $1,510 Month 3 — self-hosted: $1,664 Month 4 — self-hosted: $1,819 Month 5 — self-hosted: $1,974 Month 6 — self-hosted: $2,129 Month 7 — self-hosted: $2,284 Month 8 — self-hosted: $2,439 Month 9 — self-hosted: $2,593 Month 10 — self-hosted: $2,748 Month 11 — self-hosted: $2,903 Month 12 — self-hosted: $3,058 Month 1 — serverless: $302 Month 2 — serverless: $305 Month 3 — serverless: $307 Month 4 — serverless: $309 Month 5 — serverless: $312 Month 6 — serverless: $314 Month 7 — serverless: $316 Month 8 — serverless: $318 Month 9 — serverless: $321 Month 10 — serverless: $323 Month 11 — serverless: $325 Month 12 — serverless: $328 Month 1 — managed (free tier): $0 Month 2 — managed (free tier): $0 Month 3 — managed (free tier): $0 Month 4 — managed (free tier): $0 Month 5 — managed (free tier): $0 Month 6 — managed (free tier): $0 Month 7 — managed (free tier): $0 Month 8 — managed (free tier): $0 Month 9 — managed (free tier): $0 Month 10 — managed (free tier): $0 Month 11 — managed (free tier): $0 Month 12 — managed (free tier): $0 $3,058 $328 $0 $0$1k$2k$3k136912 months
Cumulative all-in cost of one agent over a year — infrastructure plus your time at $75/h. The month-1 setup dominates: the lines never converge.

What you're really paying for

The infrastructure cost is noise. The real cost is your time.

Setup time Monthly maintenance Year 1 engineer cost
Self-hosted 16 hours 2 hours $1,200 + $1,800 = $3,000
Serverless (Lambda) 4 hours 1 hour $300 + $900 = $1,200
Managed (HollowHost) 5 minutes 0 $0

For one agent, the difference is $3,000/year of engineering time. For ten agents, self-hosting burns $30,000/year just keeping the lights on.

Self-hosted Self-hosted: $3,000/year of engineering time (16 h setup + 2 h/month) $3,000 Serverless (Lambda) Serverless (Lambda): $1,200/year of engineering time (4 h setup + 1 h/month) $1,200 Managed (HollowHost) Managed (HollowHost): $0/year of engineering time (5 minutes, no maintenance) $0 $0$1k$2k$3k
Year-1 engineering cost per model (setup + maintenance at $75/h) — the number that dwarfs every AWS line item. Ten self-hosted agents: $30,000/year.

The bottom line

AI agents don't cost much to run. They cost a lot to host yourself — not in AWS bills, but in engineering hours spent on infrastructure instead of agent logic. The cheapest option isn't Lambda. It's not having to think about infrastructure at all.


Deploy AI agents for $0/month. Start on HollowHost — free tier included.