In short.
OpenRouter’s Async Tools guide helps AI application developers handle slow tasks, but background jobs run inside the application and jobs handed to external systems pause the conversation. It documents how tools return pending acknowledgements, deliver completed results at model-turn boundaries and expose progress through a shared task tool. External completion requires saved conversation state and application-managed webhook authentication. Child agents have additional persistence and hook restrictions. SDK compatibility, production reliability, pricing and licensing are not established by this page, and the examples were not executed.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete page at [https://openrouter.ai/docs/agent-sdk/call-model/async-tools.md], including lifecycle descriptions, examples, task inspection, steering, child agents, events, options and inline notices. The documentation-index notice and links are present, but the index and linked Tools, Tool Approval & State, Streaming and Lifecycle Hooks pages are excluded. Runtime behavior, external integrations, restart recovery and deployment reliability remain untested.
The overview
Identity
This is OpenRouter’s documentation page for asynchronous tools in its Agent SDK, published at [https://openrouter.ai/docs/agent-sdk/call-model/async-tools.md]. It is a guide to a library feature, with TypeScript examples using @openrouter/agent and Zod.
Its scope includes synchronous, background and deferred execution; task inspection and steering; child-agent tools; events; and configuration options.
Assessment
The guide provides useful implementation detail for developers whose agents need to coordinate slow work. Its strongest contribution is explaining what happens while a task runs, when its result reaches the model and what happens if the model finishes first.
It is not a complete deployment tutorial. Installation, authentication, persistent-state implementation and external-service integrations are not supplied. The documented behavior has not been independently tested here.
Users
The main audience is developers building AI applications that render media, run pipelines, request human reviews or delegate research. Beginners can learn the lifecycle distinctions, but implementing the examples requires familiarity with asynchronous TypeScript functions, schemas and model tool calls.
Experienced developers will find details about task settlement, concurrency, timeouts, event streams and process boundaries. People seeking a ready-to-use assistant would still need an application built around these APIs.
Capabilities
Background tools let the model continue working while a tool runs in the same process. Deferred tools register externally completed work and pause the conversation. Both require an outputSchema so the later result can be validated.
A shared task tool supports status checks, recent logs, transcripts, steering, result retrieval and cancellation. Applications can also inspect tasks, send guidance and cancel through ModelResult methods. Generator yields or ctx.log() calls provide progress entries.
tool.agent() turns a child model conversation into a background tool. The parent normally receives its mapped result, while the child transcript is available on demand. Dedicated stream events report task starts, progress and settlement.
Using it
Requirements
The examples use @openrouter/agent, Zod schemas and an OpenRouter client. References such as renderer, legal, searchTool and fetchTool require application-specific implementations; the page does not provide those services.
Deferred tools require a StateAccessor so another process can locate and resume the paused conversation. Completion endpoints must authenticate incoming requests before delivering results. Supported runtimes, SDK versions, installation commands, account requirements and credential configuration are not specified.
Mechanism
A tool has a run handler and a lifecycle. The default sync lifecycle waits for completion. A background tool that finishes within graceMs, which defaults to 250 milliseconds, returns like a synchronous call. Otherwise, the model receives a pending placeholder with a taskId. The SDK inserts the completed result as a tool_task_result message before the next model turn.
A deferred handler registers external work and returns ctx.defer(taskId). The conversation enters awaiting_async_tools. Another process can call the tool’s resolve, fail or cancel method using saved state. Providing run continues the conversation immediately; omitting it records the completion for the next callModel({ state }). Repeated settlement throws ToolTaskAlreadySettledError.
When background tasks outlast the model’s answer, onRunEnd controls the outcome. The default drain waits and allows extra turns without tools; detach returns while work continues and drops results, recording them as orphaned when state is configured; cancel aborts outstanding tasks.
Setup
Define a tool with its name, description, inputSchema, outputSchema and run handler. Choose background or deferred execution, then supply the tool to callModel. Add an acknowledgement, timeout and progress reporting where appropriate.
For background work, choose the end-of-run policy and configure concurrency and drain limits. For deferred work, implement persistent conversation access, register the external job and connect its completion handler to resolve, fail or cancel. The page links to separate state documentation, so it does not establish a complete StateAccessor implementation.
Example
The video example defines render_video as a background tool with script input and a result containing url and durationMs. Its handler starts a renderer, forwards steering messages to the job, yields progress and returns the finished result. The model is asked to render an introduction and draft an announcement while rendering proceeds. This illustrates intended behavior; no execution result is supplied.
The legal-review example first checks for a cached verdict. Otherwise, it opens a ticket and defers using the ticket ID. A later webhook resolves the task with an approval result and can resume the conversation. The renderer and legal-service implementations are omitted.
Assessment & evidence
Limitations
Background execution remains in the current process; the page does not establish restart recovery for that work. Deferred tasks retain status and a bounded last log through saved state, but full logs and transcripts live only in memory. Steering deferred work through sendToTask is unsupported because the SDK cannot reach its external worker.
Child agents run in memory without a StateAccessor and do not inherit parent hooks. Child hooks must be supplied explicitly. A child that pauses for human input, approval or a deferred tool fails its task.
Internal task-tool calls bypass doom-loop detection, per-tool concurrency and timeout limits, and PreToolUse/PostToolUse hooks. The name task is reserved. Transcript views are truncated to a default 20,000 characters, and logs have ring-buffer limits.
Runtime schema validation does not authenticate external completions. Timeout signalling is documented, but whether a particular renderer or worker actually stops depends on its integration and remains untested.
Reasoning
Based on the documented lifecycle rules, background execution fits work that can overlap with other model activity inside the application process. Deferred execution fits work completed elsewhere, provided pausing and later resuming the conversation is acceptable.
The state, hook and child-agent restrictions are material design considerations. Saved parent state does not establish durable child execution, and output validation does not establish that a completion came from an authorized sender. These conclusions follow from the documented boundaries, without performance or reliability measurements.
Alternatives
The page presents three execution choices within the SDK. Sync is suitable for short calls that can hold up the conversation. Background allows overlapping work in the same process. Deferred hands completion to another system and pauses the conversation.
For background tasks, drain, detach and cancel offer different finishing behavior. Competing SDKs, workflow engines, durable job systems and comparative benchmarks are not covered, so no product comparison is established.
Evidence
The evidence is the complete OpenRouter Async Tools page at [https://openrouter.ai/docs/agent-sdk/call-model/async-tools.md]. It contains explanatory text, TypeScript examples, option tables and operational caveats.
No code was executed. The examples establish documented API usage, without measured latency, throughput, cancellation effectiveness or production reliability. Linked documentation is outside the available evidence.
Access & freshness
Costs
The page supplies no SDK pricing, model rates, infrastructure costs or external-service charges. Total operating cost is unknown.
It says the shared task tool has one fixed definition regardless of the number of asynchronous tools. That describes the helper’s prompt overhead, not total application cost. Extra drain turns and child-agent conversations involve additional model activity, but their token usage and charges are not quantified.
Rights
The page does not state a licence for the SDK, documentation or example code. Redistribution permissions, commercial-use terms and attribution requirements are unknown from this evidence.
Freshness
The page capture is dated 2026-11-13T06:13:22.473Z and identifies source revision sha256:43fc8a6c2bb9f9db49547ef32f7fe197097c92fdb48a6683ea319043208cc901.
The page gives no publication date, last-update date or SDK release number. Compatibility with a particular installed package version and changes after capture are unknown. Model identifiers appearing in examples do not establish current availability.
Actions
Choose the lifecycle according to whether the model should continue working and where the job completes. For background tools, decide what should happen when the answer finishes first, then configure deadlines, concurrency and progress reporting.
For deferred tools, implement StateAccessor storage, authenticate completion requests and handle already-settled tasks. Check package compatibility and the linked state documentation before implementation. Before deployment, verify end-of-run behavior, cancellation, process restarts, duplicate completions and child-hook behavior in the intended application.
