How to Build Your Own Always-On AI Agent
This tutorial builds an always-on agent in TypeScript with the OpenRouter Agent SDK (@openrouter/agent 0.11.0) that checks Hacker News on a schedule, writes a digest of new relevant stories, remembers seen story IDs across restarts, and caps each run at six steps or five cents. Each check cost $0.0003 to $0.0012 with Claude Haiku 5.5 in the author's runs on October 13, 2026, roughly $0.86 to $3.46 a month at one check every 15 minutes. It also covers pausing a run for human approval before a tool posts to a team channel, resuming after a crash, and deploying on a VPS or scheduled job.
Why it matters: It offers a concrete, cost-measured walkthrough of the practical pieces—scheduling, memory, spend limits, and approval—that separate a demo agent from one that runs unattended.