Cloudflare is all you need

AIMay 6, 202612 min read
Cloudflare is all you need

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.

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.

An agent is just a class. You extend Agent, keep state with setState, and route requests to it:

import { Agent, routeAgentRequest, callable } from "agents";

export class Counter extends Agent<Env, { count: number }> {
  initialState = { count: 0 };

  @callable()
  increment() {
    this.setState({ count: this.state.count + 1 });
    return this.state.count;
  }
}

export default {
  async fetch(request, env) {
    return (await routeAgentRequest(request, env)) ?? new Response("Not found", { status: 404 });
  },
} satisfies ExportedHandler<Env>;

The starter for the Agents SDK also includes streaming chat, tools, human-in-the-loop approval, scheduling, and Workers AI by default. Scaffold it with npm create cloudflare@latest -- --template cloudflare/agents-starter (cloudflare/agents-starter).

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/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/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/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.

Flue, if you want a harness

The Agents SDK gives you the runtime. Flue, an open agent framework from the team behind Astro — which Cloudflare acquired in January 2026 — gives you the harness on top: sessions, tools, skills, and a secure sandbox. It's powered by the Pi harness and runs multi-cloud (write once, deploy anywhere, any LLM), but Cloudflare is the target it maps onto most cleanly. The idea is that you describe what an agent knows instead of scripting what it does:

import { createAgent } from "@flue/runtime";

export default createAgent(() => ({
  model: "anthropic/claude-sonnet-4-6",
  instructions: "Tell a funny hello-world engineering joke.",
}));
npm install @flue/runtime
npx flue init --target cloudflare

When you target Cloudflare, each Flue agent becomes its own Durable Object — isolated storage, isolated compute, scales to as many agents as you spin up, costs nothing idle. Write once, run on whatever model you choose, deploy without lab lock-in.

Example code: withastro/flue · Cloudflare's launch post.