At 100GB storage and 10 million requests/month, AWS S3 costs $23.40. Cloudflare R2 costs $1.50. The 84% cost reduction comes from one thing: R2 charges $0 for egress. S3 charges $0.09/GB. For AI projects that generate, store, and serve data constantly, this isn't a minor savings — it's the difference between viable and expensive.
The Full Pricing Breakdown
Storage Costs
| Service | Free Tier | Price/GB | 100GB/month |
|---|---|---|---|
| Cloudflare R2 | 10 GB/month | $0.015 | $1.35 |
| AWS S3 (us-east-1) | None (paid) | $0.023 | $2.30 |
| AWS S3 (first 50TB) | 12 months free* | $0.023 | $2.30 |
*AWS Free Tier is 5GB for 12 months, new accounts only.
Operations Costs
| Service | Write (Class A) | Read (Class B) | Free Tier |
|---|---|---|---|
| Cloudflare R2 | $0.0045/1K ops | $0.00036/1K ops | 1M writes, 10M reads/month |
| AWS S3 | $0.005/1K ops | $0.0004/1K ops | 2K PUT, 20K GET (12 mo only) |
Egress — Where the Real Difference Is
This is the number that matters. S3's storage price is defensible. It's the egress that kills you. At 500GB transferred out per month — realistic for an AI product serving generated content — S3 adds $45/month in egress fees alone. R2: $0.
Real Scenario: AI Product at Scale
Let me put this in context with a real AI product scenario. Say you're running a product that generates and stores HTML reports (like my Resume AI tool): 5,000 reports/month, ~200KB each, with each report downloaded 2–3 times by the buyer.
| Cost Component | AWS S3 | Cloudflare R2 |
|---|---|---|
| Storage (1GB/month generated) | $0.023 | $0 |
| PUT operations (5K writes) | $0.025 | $0 |
| GET operations (15K reads) | $0.006 | $0 |
| Egress (3GB delivered to buyers) | $0.27 | $0 |
| Monthly Total | $0.32 | $0.00 |
At this scale R2's advantage is modest. But scale it up: 50K reports/month, 10GB storage, 30GB delivered. S3: $4.93/month. R2: $0.15/month. The gap compounds as you grow.
R2's Permanent Free Tier
Unlike S3's 12-month free trial, R2's free tier is permanent:
- 10 GB storage/month — always free
- 1 million Class A operations/month (writes, lists)
- 10 million Class B operations/month (reads)
- $0 egress — no asterisk, no conditions
For an early-stage AI product at under 10GB storage and moderate traffic, this means $0/month in storage costs indefinitely. I ran my entire product delivery system on R2's free tier for the first four months.
R2 Is S3-Compatible — Migration Is One Endpoint Change
The practical question with any migration is: how much code do I have to rewrite? With R2, the answer is zero. R2 implements the S3 API. Any code using the AWS SDK works by changing the endpoint URL:
// AWS SDK v3 — before (S3)
const s3 = new S3Client({
region: 'us-east-1',
credentials: { accessKeyId: AWS_KEY, secretAccessKey: AWS_SECRET }
});
// After (R2) — only endpoint changes
const r2 = new S3Client({
region: 'auto',
endpoint: `https://${ACCOUNT_ID}.r2.cloudflarestorage.com`,
credentials: {
accessKeyId: R2_ACCESS_KEY_ID,
secretAccessKey: R2_SECRET_ACCESS_KEY
}
});Every S3 operation — PutObject, GetObject, DeleteObject, ListObjectsV2, presigned URLs — works identically. I migrated my product delivery worker from S3 to R2 in 20 minutes, mostly spent verifying the output was identical.
When to Stick With S3
R2 wins on cost for most solopreneur AI workloads. But S3 has real advantages in specific cases:
- Object versioning. R2 versioning is in beta and limited. If you need full version history with lifecycle management, S3's versioning is more mature.
- Storage class tiering. S3 Intelligent-Tiering, Glacier, and Deep Archive have no R2 equivalent. If you're archiving training data or model checkpoints you rarely access, S3 Glacier at $0.004/GB beats R2's $0.015/GB.
- AWS ecosystem integration. Lambda, EC2, ECS all have native S3 access without egress charges within the same region. If your stack is AWS-native, the integration simplicity may outweigh R2's pricing advantage.
- Compliance requirements. S3 has a longer enterprise compliance track record (HIPAA, FedRAMP, etc.). For consumer AI products, this rarely matters.
The Decision Framework
Use R2 if:
- You're on Cloudflare Workers (same ecosystem, no egress between R2 and Workers)
- Your users download generated content (AI outputs, reports, processed files)
- You're under 10GB/month storage (permanent free tier)
- You want to eliminate a variable cost from your infrastructure
Use S3 if:
- Your stack is AWS-native and you benefit from free intra-region transfer
- You need advanced lifecycle management or archive tiers
- You require compliance certifications R2 doesn't currently hold
For the typical solopreneur building AI products on Cloudflare Workers — which is exactly the stack I document here — R2 is the default choice. The zero-egress model pairs perfectly with Workers (which also serve egress-free to end users through Cloudflare's network). The free tier covers early traction. The pricing scales predictably. And the migration cost from S3 is one line of code.
The Complete Zero-Cost Storage Setup
The Zero-Cost AI Kit includes R2 integration templates, wrangler configs for both development and production, and the presigned URL pattern for secure file delivery — the exact setup I use across every Browning Digital product.
Get the Zero-Cost AI Kit — $47