SokkoSokko
← Back to blog

How Much Does It Cost to Run an AI Agent 24/7?

Sokko Team10 min read

So How Much Does It Cost to Run an AI Agent 24/7?

How much does it cost to run an AI agent 24/7? The honest answer is a range, not a single number, and most people get it wrong because they price the server and forget the tokens. A 24/7 agent has five real line items: VPS compute, LLM token spend, storage and egress, monitoring, and your own time. For a light agent the whole thing can land near $17 a month. For a busy agent chewing through large contexts, the bill can pass $700 a month, and almost all of the increase is tokens, not hardware.

This piece tracks every dollar. Real provider prices, a worked token example you can copy, and a full monthly table for a light agent and a heavy one. No hand-waving.

Line Item 1: VPS Compute ($4 to $48 a Month)

The server is the cheapest part, which surprises people who assume compute dominates. Because the model runs on the provider's side, your box mostly holds the agent process, its workspace, and whatever builds or scripts it runs. No GPU required.

TierExamplevCPU / RAMMonthly
EntryHetzner CX222 / 4 GBabout $5
SmallDigitalOcean basic1 / 2 GB$12
MidHetzner CPX314 / 8 GBabout $16
LargeDigitalOcean 8 GB4 / 8 GB$48

The value floor is a Hetzner CX22 at roughly $5 a month; current sizing lives on the Hetzner Cloud page. DigitalOcean costs more but adds a polished dashboard and one-click backups. For most single-agent setups, spending more than $16 a month on compute is over-provisioning. The dollars that matter are downstream. If you are choosing hardware, our guide to AI agent VPS hosting compares providers in more depth.

Line Item 2: LLM Tokens (The Part That Surprises People)

This is where the bill actually lives. Every task the agent runs sends context to the model (files, history, tool output) and gets tokens back. You pay per million tokens in and per million out, and output tokens usually cost several times more than input.

Here are representative prices. Verify current numbers on the Anthropic pricing and OpenAI pricing pages, because they change.

ModelInput / 1M tokensOutput / 1M tokens
GPT-4o mini$0.15$0.60
Claude Haiku$0.80$4.00
GPT-4o$2.50$10.00
Claude Sonnet$3.00$15.00

A worked example you can copy

Suppose your agent runs 40 tasks a day. Each task feeds about 30,000 tokens of context into the model and gets back 3,000 tokens. That is 1.2M input and 120k output tokens per day, or roughly 36M input and 3.6M output tokens in a 30-day month.

Now price the same workload on three models:

  • Claude Haiku: 36 times $0.80 equals $28.80 input, plus 3.6 times $4.00 equals $14.40 output. Total about $43 a month.

  • GPT-4o: 36 times $2.50 equals $90 input, plus 3.6 times $10 equals $36 output. Total about $126 a month.

  • Claude Sonnet: 36 times $3.00 equals $108 input, plus 3.6 times $15 equals $54 output. Total about $162 a month.

Same work, a nearly 4x spread in cost depending on the model. The lever that moves your bill the most is model choice, not server size.

You can reproduce any of these with one line. Plug in your own monthly token volumes and the model's per-million prices:

# Monthly token cost = (input_M * in_price) + (output_M * out_price)
IN_M=36          # million input tokens per month
OUT_M=3.6        # million output tokens per month
IN_PRICE=3.00    # USD per 1M input tokens (Claude Sonnet)
OUT_PRICE=15.00  # USD per 1M output tokens
echo "$IN_M * $IN_PRICE + $OUT_M * $OUT_PRICE" | bc -l
# => 162.00

Swap the four numbers for your workload and model, and you have a defensible monthly estimate in seconds.

Scale to the heavy end and the numbers get loud. An agent running around 170 tasks a day with 30,000-token contexts lands near 150M input and 15M output tokens a month. On Sonnet that is roughly $450 input plus $225 output, about $675 before any caching, which matches the heavy column in the table further down. Route the easy half of those tasks to Haiku and turn on caching for the repeated context, and the same work can fall under $400. The single biggest cost decision you make is not the server; it is how you feed and price the model.

Two knobs that cut token cost

  • Prompt caching. If your agent re-sends the same large context (a system prompt, a codebase snapshot), caching can cut the input portion by up to 90 percent on repeated calls. For an agent that reuses context all day, this is real money.

  • Right-sizing the model. Route cheap tasks to Haiku or GPT-4o mini and reserve Sonnet or GPT-4o for the hard ones. A mixed routing strategy often halves the token bill with no quality loss on the easy work.

Line Item 3: Storage, Egress, and Backups

These are small but not zero. The agent's workspace, git checkouts, and logs grow over time. Budget the following:

  • Block storage: most VPS tiers include 40 to 160 GB. Extra volumes run about $0.05 to $0.10 per GB per month, so a 50 GB add-on is roughly $2.50 to $5.

  • Egress: Hetzner includes 20 TB; DigitalOcean includes 1 to 5 TB per droplet. A normal agent that only talks to the model API and a git host uses a tiny fraction of that, so egress is usually below $1 a month unless you move large artifacts.

  • Backups: provider snapshots typically cost about 20 percent of the instance price. On a $5 box that is roughly $1 a month, and it is worth it so a bad task cannot erase weeks of workspace state.

For a light agent, this whole category is $1 to $3 a month. For a heavy one moving bigger artifacts, budget $5 to $10.

Line Item 4: Monitoring and Your Own Time

A process being "up" tells you nothing about whether the agent is completing tasks. Real monitoring watches task success, error rates, and token burn so a rotated API key or a stuck loop does not quietly cost you money for a week.

  • Self-hosted monitoring (a Prometheus and Grafana stack, or Netdata) is free in dollars but costs setup hours and lives on the same box you are trying to watch.

  • Hosted monitoring (Grafana Cloud free tier, or a small paid plan) runs $0 to $10 a month for a single agent.

The line item nobody prices is your time. If you self-host, budget two to four hours for the initial build and a few hours a month for upgrades, disk cleanups, and the occasional 3 a.m. restart. At even a modest hourly value, that time can exceed the entire hardware bill. We break the self-hosting mechanics down in self-host OpenClaw on VPS 24/7, including the systemd setup that keeps the agent alive across reboots.

Put a real number on it. If you value your time at $50 an hour and self-hosting eats four hours in a given month, that is $200 of effort stacked on top of a $17 server bill. The dollars you saved on compute vanish the first evening you spend chasing a disk-full alert. This does not make self-hosting wrong; it means the true cost of running an agent 24/7 includes the hours, and any honest comparison has to count them next to the tokens and the server.

The Full Monthly Bill: Light vs Heavy Agent

Here is every dollar in one place. The light agent handles a handful of small tasks a day on a cheap model. The heavy agent runs busy, large-context workloads on a premium model.

Line itemLight agentHeavy agent
VPS compute$5 (Hetzner CX22)$48 (4 vCPU / 8 GB)
LLM tokensabout $10 (Haiku, ~8M in)about $675 (Sonnet, ~150M in)
Storage and backups$1$5
Egressunder $1$3
Monitoring$0 (self-hosted)$10 (hosted)
Total (dollars)about $17 / moabout $741 / mo
Your time2 to 4 hrs/mo4 to 8 hrs/mo

Two takeaways. First, at the light end the server is the biggest visible cost and the whole thing fits under $20 a month. Second, at the heavy end tokens are 90 percent of the bill, so optimizing the model and caching matters far more than shaving the server. If you are staring at a heavy-agent bill, tune tokens first.

To verify these figures for your own workload, plug your daily task count and average token sizes into the worked example above. The math scales linearly, so doubling tasks roughly doubles the token line.

Does a Managed Runtime Cost More to Run an AI Agent 24/7?

A managed runtime adds a platform fee on top of tokens, typically $12 to $99 a month depending on size and how many agents you run. On paper that is more than a $5 VPS. In practice the comparison is not server-to-server, it is server-plus-your-time versus platform-with-no-ops. If you self-host, you still pay every token, and you add hours of setup, monitoring, and patching. The managed fee buys those hours back.

This is the honest place Sokko fits. It runs agents like OpenClaw, Hermes, Paperclip, and OpenSRE on secure, always-on infrastructure we manage for you, with a persistent workspace, secure secrets, team roles, controlled network access, and observability already wired up, so you do not staff the on-call role for your own automation. You still pay for tokens (nobody escapes that), but the compute, restarts, and monitoring are handled and you skip the infrastructure learning curve. For a single hobby agent, a bare VPS is cheaper and totally reasonable. For several agents that matter, the platform fee is often less than the time you would otherwise spend keeping boxes alive.

If you want the broader hosting picture before you commit, our overview of how to run an AI agent in the cloud compares VPS, managed runtime, and serverless side by side.

FAQ

What is the cheapest way to run an agent 24/7? A Hetzner CX22 at about $5 a month plus a low-cost model like Haiku or GPT-4o mini. Total can land near $17 a month for light use, before counting your time.

Why are my token costs so high? Output tokens cost several times more than input, and large contexts add up fast. Switch cheap tasks to a smaller model and turn on prompt caching for repeated context.

Does compute or tokens cost more? For anything beyond light use, tokens dominate. On the heavy example above, tokens are roughly 90 percent of the monthly bill.

Is a managed runtime worth the extra fee? If your time is worth more than the hours you spend on setup, monitoring, and patching, yes. If the agent is a low-stakes hobby, a bare VPS is cheaper.