Building AI Agents on Cloudflare

Cloudflare has one of the most generous free plans I've seen for building websites in the last 10 years, and it is still true now that they are shifting focus to AI agents. With the free tier, you already get enough for personal projects and medium-scale workloads.

Start with agents.cloudflare.com. It already lists almost everything you need.

npm i agents

Cloudflare's agents SDK is a good one, alongside the AI SDK.

Each agent runs as a TypeScript class on a Durable Object, with its own SQL database, WebSocket connections, scheduling, state, and lifecycle.

The stack is simple: run agent logic on Workers, keep state in Durable Objects, call models with Workers AI or AI Gateway, retrieve knowledge from AI Search or Vectorize, and let agents act through Browser Run, MCP, Queues, Workflows, Email, Dynamic Workers, and Sandboxes.

The starter for the Agents SDK also includes streaming chat, tools, human-in-the-loop approval, scheduling, and Workers AI by default.

This is the free/pricing snapshot they offer today:

ServiceFree budgetPricing
Agents SDKNo separate quota. Uses Workers and Durable Objects.Pay for the underlying services. (Cloudflare Docs)
Workers100k requests/day, 10 ms CPU/invocation.Paid starts at $5/mo: 10M requests/mo, 30M CPU-ms/mo, then usage-based overage. (Cloudflare Docs)
Durable Objects100k requests/day, 13k GB-s/day, SQLite-backed DOs on Free.Paid includes 1M requests/mo and 400k GB-s/mo, then overage. (Cloudflare Docs)
Workers AI10k Neurons/day.$0.011 per 1k Neurons after free allocation on Paid. (Cloudflare Docs)
AI GatewayCore features free; 100k persistent logs total on Free.Paid has 10M logs/gateway. Logpush: $0.05/M requests. Guardrails bill through Workers AI. (Cloudflare Docs)
AI SearchOpen beta: 100 instances, 100k files/instance, 20k queries/mo, 500 crawled pages/day.Paid: 5k instances, 1M files or 500k hybrid search, unlimited queries/crawling. Future pricing has not been announced yet. (Cloudflare Docs)
Vectorize30M queried vector dimensions/mo, 5M stored dimensions.Paid includes 50M queried dimensions/mo and 10M stored dimensions, then 0.01/Mqueriedand0.01/M queried and 0.05/100M stored. (Cloudflare Docs)
D15M rows read/day, 100k rows written/day, 5 GB storage.Paid includes 25B reads/mo, 50M writes/mo, 5 GB storage, then overage. (Cloudflare Docs)
R210 GB-month, 1M Class A ops, 10M Class B ops, free egress.0.015/GBmonth,0.015/GB-month, 4.50/M Class A, $0.36/M Class B, egress free. (Cloudflare Docs)
KV100k reads/day, 1k writes/day, 1 GB storage.Paid includes 10M reads/mo and 1M writes/mo, then usage-based overage. (Cloudflare Docs)
Queues10k operations/day, 24h retention.Paid includes 1M operations/mo, then $0.40/M operations. (Cloudflare Docs)
WorkflowsIncluded on Free; shares Workers limits; 1 GB storage.Same as Workers pricing, plus workflow storage after quota. (Cloudflare Docs)
Browser Run10 min/day, 3 concurrent browsers.Paid includes 10 hours/mo and 10 browsers, then 0.09/hourand0.09/hour and 2/browser. (Cloudflare Docs)
MCP ServersCloudflare provides managed remote MCP servers.Cost depends on the services/tools used by the MCP server. (Cloudflare Docs)
Email ServiceInbound Email Routing is unlimited. Outbound email is not on Free.Paid includes 3k outbound emails/mo, then $0.35/1k emails. (Cloudflare Docs)
Dynamic WorkersPaid only.1k unique Dynamic Workers/mo included, then $0.002 per Dynamic Worker/day. Requests and CPU bill as Workers. Billing starts May 26, 2026. (Cloudflare Docs)
Sandboxes / ContainersNo free container budget.Paid includes 25 GiB-hours, 375 vCPU-min, 200 GB-hours/mo, then usage-based overage. (Cloudflare Docs)
Realtime1,000 GB free tier.$0.05/GB egress after the free tier. (Cloudflare Docs)

My default stack

For a simple agent, I would start with:

Workers + Agents SDK + Durable Objects + Workers AI + AI Gateway + AI Search

Then add:

Browser Run for web browsing, Queues and Workflows for background jobs, R2 for files, Email Service for email agents, and Sandboxes or Dynamic Workers for coding agents.

·9 days ago
4 min read
AIEdit

Series: AI Harness Engineering

Building AI Agents on Cloudflare

Cloudflare's Agents SDK runs stateful TypeScript agents on Durable Objects, with Workers AI, AI Gateway, AI Search, Vectorize, Browser Run, Queues, Workflows, Email, Dynamic Workers, and Sandboxes around it.

Claws

OpenClaw, NanoBot, PicoClaw, ZeroClaw, NullClaw, NemoClaw, ...

Coding Agents

Reflect on what I'm thinking and doing in this LLM era