Some primitives for building long-horizon agents: https://t.co/LMOT3loMF8 https://t.co/TU4ijNzEdI
OpenRouter Adds Long Horizon Primitives to Build Durable Multi Hour Agents
· Updated
OpenRouter released a suite of primitives for its Agent SDK designed to support autonomous tasks that run for hours. These tools handle the complex state management and cost controls required to move AI agents from simple chat interactions to reliable, long-running production workflows.
- Availability
- @openrouter/agent TypeScript SDK
- Cost controls
- maxCost and stepCountIs ceilings
- State management
- Resumable state with StateAccessor
- Voice support
- Speech-to-text and text-to-speech
- Monitoring
- Real-time streaming of tool calls and events
Building reliable agents is difficult because long-running loops are prone to network failures and runaway costs. This release addresses those risks by providing built-in cost and step ceilings alongside automatic retries with backoff. It builds on OpenRouter's human-in-the-loop tools to ensure high-stakes decisions remain under human control.
You can now implement resumable state to persist conversation history, allowing agents to continue after a crash or manual pause. The SDK also includes new voice endpoints for driving loops via speech and a self-ask pattern to reduce hallucinations. These features are available now through the @openrouter/agent TypeScript library.
Still wondering? A few quick answers below.
Every HeadsUpAI update is written based on its original source and reviewed before it's published. Read our editorial standards →


