OpenRouter详解构建常驻智能体
OpenRouter 发布 TypeScript 教程,演示如何使用 @openrouter/agent 0.11.0 构建监测 Hacker News、生成摘要并在重启后记住已读内容的常驻智能体。示例涵盖定时执行、工具调用、持久化状态、敏感操作审批、单次运行步骤与成本限制,以及 API 密钥额度限制。OpenRouter 称,在 2026 年 10 月 13 日的教程测试中,Claude Haiku 5.5 每次检查成本为 0.0003 至 0.0012 美元。
该教程给出了将定时运行、持久化记忆、人工审批、可恢复执行和明确成本控制结合到智能体中的具体实现方案。
How to Build Your Own Always-On AI Agent
OpenRouter ·10/31/2026


An always-on AI agent is a program that wakes up on a schedule, uses tools to check on something, decides what matters, and acts or reports without you asking each time. At DevDay 2026, OpenAI announced Dots, its version of always-on agents. You can also build your own, choosing the model, tools, and how much each run can spend.
In this tutorial, we build one in TypeScript with the OpenRouter Agent SDK that watches Hacker News for topics you choose, writes a digest of what’s worth reading, remembers what it has already seen across restarts, and stops any run that reaches five cents. Each check costs us between $0.0003 and $0.0012. This same structure works for any agent that should keep running, such as one that watches a repository or a status page, and then takes an action.
#OpenRouter Agent SDK#@openrouter/agent 0.11.0#Claude Haiku 5.5#Hacker News