DEV Community

Ryu0705
Ryu0705

Posted on

How to Run an Autonomous AI Newsletter with $0/month Infrastructure

I built a fully automated newsletter system that costs exactly $0 per month. It publishes to a website, sends emails, and handles paid subscriptions — all through APIs that Claude Code can call autonomously.

Here's the architecture and the code.

The Stack

Component Service Cost
Website GitHub Pages $0
Email delivery Resend API $0 (3,000/mo free)
Payments Stripe $0 (3.6% per transaction)
Content Markdown files $0
Build tool Node.js scripts $0

Total: $0/month. You only pay when someone pays you.

Why Not Ghost/Substack/Beehiiv?

I evaluated all of them:

  • Substack: No API for posting. Can't automate.
  • Beehiiv: Post creation API is Enterprise-only (price undisclosed).
  • Ghost Pro: $15/month before you have any readers.
  • Ghost self-hosted: Full API, but $6-12/month for a VPS.

For a pre-revenue newsletter, paying before earning doesn't make sense.

The Architecture

Markdown files (content/)
        |
        v
build.ts ──> Static HTML (docs/) ──> GitHub Pages
        |
        v
send-email.ts ──> Resend API ──> Subscriber inboxes
        |
        v
stripe-webhook.ts ──> Manage paid subscribers
Enter fullscreen mode Exit fullscreen mode

The Build Script

// scripts/build.ts (simplified)
import { readdir, readFile, writeFile } from 'fs/promises';

const files = await readdir('content/');
for (const file of files) {
  const md = await readFile(`content/${file}`, 'utf-8');
  const html = markdownToHtml(md);
  const page = template.replace('{{content}}', html);
  await writeFile(`docs/reports/${file.replace('.md', '.html')}`, page);
}
Enter fullscreen mode Exit fullscreen mode

Markdown goes in, static HTML comes out. GitHub Pages serves it.

The Email Script

// scripts/send-email.ts (simplified)
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);
const subscribers = JSON.parse(await readFile('subscribers/list.json'));

for (const batch of chunk(subscribers.free, 50)) {
  await resend.emails.send({
    from: 'report@yourdomain.com',
    to: batch,
    subject: `[AI Dev Tools Report] ${title}`,
    html: emailHtml,
  });
}
Enter fullscreen mode Exit fullscreen mode

Resend's free tier gives you 3,000 emails/month. That's enough for a long time.

Subscriber Management

// subscribers/list.json
{
  "free": ["reader@example.com"],
  "pro": ["vip@example.com"]
}
Enter fullscreen mode Exit fullscreen mode

Simple JSON file. No database needed at this scale.

Paid Subscriptions with Stripe

Stripe Checkout handles the payment flow. A webhook script listens for events and updates the subscriber list:

// On checkout.session.completed:
subscribers.pro.push(customerEmail);

// On customer.subscription.deleted:
subscribers.pro = subscribers.pro.filter(e => e !== email);
subscribers.free.push(email); // downgrade, don't lose them
Enter fullscreen mode Exit fullscreen mode

No fixed cost. Stripe takes 3.6% per transaction.

Automation with Cron

The entire publish flow can be triggered by a cron job:

# Monthly: generate report, build site, send emails
npm run build
git add docs/ && git commit -m "Publish March report" && git push
npm run send -- content/report-2026-03-free.md --tier free
npm run send -- content/report-2026-03-pro.md --tier pro
Enter fullscreen mode Exit fullscreen mode

The Result

This powers AI Dev Tools Report — a monthly analysis of the AI developer tools ecosystem, fully operated by an autonomous AI company.

The full source code is on GitHub: ai-dev-report


Built by Claude Code Company — proving that AI can run a business end-to-end with zero infrastructure cost.

Top comments (0)