Learning resourcesReviewed · OpenRouter

Delegate Routine Work to Cheaper Models

This OpenRouter guide teaches app developers to assign routine AI work to cheaper models, but its beta tool adds cost and latency with every delegation. It explains openrouter:subagent, a server tool that lets a coordinating model assign focused tasks to a worker model and combine the results. Actual savings and runtime reliability are not assessed.

Researched 23 Nov 2026

In short.

This OpenRouter cookbook guide shows developers how to delegate routine AI tasks to cheaper models, but its beta tool adds model calls and does not guarantee lower total cost. It documents request construction, worker context, optional worker tools, generation limits, streaming completion checks and combined usage reporting. Its strongest application is bulk summarization, extraction, reformatting or drafting within an existing OpenRouter integration. The examples are instructional; runtime correctness, answer quality, latency and actual savings are not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is limited to the complete documentation page at [https://openrouter.ai/docs/cookbook/building-agents/subagent-server-tool.md], including its examples, beta warning, cost caveats, worker-tool restrictions and streaming-completion guidance. Linked documentation, model pages, pricing, service terms and package contents are excluded. The page supplies no explicit license notice. Code execution, model compatibility, response quality, reliability, latency and actual savings are not assessed.

The overview

identity

Delegate Routine Work to Cheaper Models is an OpenRouter cookbook tutorial about openrouter:subagent. It teaches a coordinating model, called the orchestrator, to retain planning and final synthesis while assigning focused work to a cheaper worker model. The source is [https://openrouter.ai/docs/cookbook/building-agents/subagent-server-tool.md].

The page supplies JavaScript, TypeScript, Python, Go and cURL examples. It describes the pattern as applicable to Chat Completions, Responses and Agent SDK workflows, while exposing the request and response details mainly through Responses API examples.

assessment

The guide offers concrete implementation detail for developers who already use OpenRouter and have substantial routine text processing to delegate. It covers the context passed to workers, their optional tools, response parsing and operational failure signals.

Its cost argument depends on moving enough work to a sufficiently cheaper model without losing required quality. Each delegation still creates another model call and adds latency. The page supplies no measured comparison establishing when that tradeoff becomes worthwhile.

users

The intended readers are application developers building multi-step AI workflows, especially document processing, extraction, rewriting and drafting features. Existing OpenRouter users can apply the pattern within their current request path.

Beginners receive a clear explanation of the two model roles, but implementation assumes familiarity with API keys, HTTP or SDK requests, JSON responses and error handling. Experienced developers get details about server-side execution, streaming events, usage accounting and worker tool restrictions.

capabilities

The orchestrator can delegate summarization, extraction, reformatting and drafting, receive worker outcomes and incorporate them into its answer. Workers can also use configured OpenRouter server tools, with web search and web fetching shown as examples.

Worker configuration includes model selection, instructions, temperature, reasoning settings, an output token ceiling and a tool-call limit. Both streaming and non-streaming requests are described. Response records expose delegation details and combined usage, although the orchestrator receives only the worker's final outcome rather than its intermediate tool activity.

Using it

requirements

The page lists an OpenRouter API key in OPENROUTER_API_KEY, an existing OpenRouter workflow, an orchestrator model that supports tool calling and a cheaper worker capable of meeting the task's quality requirements. Actual model availability, compatibility and prices are not established beyond the examples.

The stated prerequisites include Node.js 20 or newer and, for the TypeScript SDK path, @openrouter/sdk and @openrouter/agent. The Python examples use requests; the cURL parsing and streaming examples use jq. Package versions and supported Python or Go versions are unspecified.

mechanism

The application adds openrouter:subagent to the request's tools array and sets the worker model in its parameters. With automatic tool selection, the orchestrator decides whether and when to delegate. Each delegation supplies a task_name and a task_description containing the inputs, context and expected output format.

The worker cannot see the parent conversation. OpenRouter executes its call server-side and returns an outcome or error to the orchestrator, which can continue delegating or produce the final answer. This keeps the delegation loop inside the service while the application makes one outer request.

The response output records delegations as openrouter:subagent items and includes the final answer in a message item's output_text content. The guide states that usage combines the orchestrator and worker calls.

setup

Choose a tool-capable orchestrator and an appropriate worker, include the actual source material in the input, and configure the subagent tool with the worker model. The guide's instructions tell the orchestrator to delegate routine tasks, provide complete worker context and retain planning and integration.

The fetch examples send JSON to [https://openrouter.ai/api/v1/responses]. The TypeScript Agent SDK example wraps tool definitions with serverTool and uses callModel with camelCase options such as toolChoice. Response handling must account for delegation errors and incomplete outer responses.

For streaming, the examples ignore SSE heartbeat comments and require response.completed before treating the answer as complete. A closed connection or a [DONE] marker alone does not establish successful completion. The telemetry examples record model routing, response status and usage while omitting task content and credentials.

example

The main example asks the orchestrator to analyze an API changelog, summarize its sections, identify breaking changes and draft a migration guide. The supplied changelog includes authentication changes, a replaced endpoint and a renamed response field. Routine section processing can be delegated before the orchestrator assembles the guide.

The TypeScript and Go examples explicitly append changelog text to the request. Some shorter examples refer to a changelog without attaching it, so they require the developer to supply that content. The displayed responses illustrate output structure; they do not establish execution results or answer accuracy.

Assessment & evidence

limitations

The subagent tool is described as beta. Delegations are capped per request, but the page leaves the exact invocation cap to a linked reference. Workers lack parent-conversation access, and their intermediate tool calls and search results are not visible to the orchestrator.

Only OpenRouter server tools are accepted directly in the worker's nested tools array; nested function tools produce a 400 response. The page separately describes experimental inheritance of top-level function tools on the Responses API. A worker cannot include the subagent tool itself, preventing recursive delegation.

A successful worker call does not establish factual accuracy or suitability for the task. Reliability, quality loss from cheaper models, throughput, latency and compatibility across particular model choices are not assessed.

reasoning

The design reserves the more capable model for planning and synthesis while moving bulk text generation to a lower-priced model. Its economic case therefore depends on the task mix, relative model prices, duplicated context and the amount of delegated output.

Server-side execution reduces the application code needed to manage the delegation loop. The tradeoff is less visibility into workers' intermediate tool activity. Because workers receive only their task descriptions, complete context and explicit output requirements are central to this pattern.

alternatives

The page describes client-side orchestration as an alternative: obtain a plan from the stronger model, call a smaller model from the application and send its results back for integration. This places the sequencing and intermediate request handling in application code. No measured comparison with server-side delegation is supplied.

It also points to Advisor for stronger-model consultation, Fusion for multi-model deliberation, response caching for repeated prefixes and structured outputs for final JSON formatting. These are brief references to related approaches; their linked documentation and behavior are outside the supplied evidence.

evidence

The evidence consists of the complete OpenRouter cookbook page at [https://openrouter.ai/docs/cookbook/building-agents/subagent-server-tool.md]. It supports the described request pattern, sample response fields, worker configuration, streaming handling and stated restrictions.

The page contains instructional code and illustrative outputs, with no execution records, measured accuracy results, latency measurements or substantiated cost comparison. Runtime behavior and claimed savings remain unassessed. Linked schemas, pricing pages and SDK references are not part of the supplied content.

Access & freshness

costs

Actual prices and total request costs are unknown. Every delegation creates a separately charged model call and adds latency. The guide recommends using returned usage.cost when available, or estimating worker spend from current model pricing. It states that response usage combines orchestrator and worker consumption.

The page suggests potential savings above 80% on generation-heavy portions using three delegated subtasks and a worker priced 50 times lower. This is an illustrative scenario, with no supporting benchmark or measured end-to-end result.

The example max_completion_tokens value of 1024 limits worker output, including reasoning. Reasoning settings and max_tool_calls offer additional controls; the documented worker tool-call range is 1 to 25. These limits do not establish a fixed total request price.

rights

The supplied page does not state a license for its prose or code examples or establish redistribution rights. OpenRouter service terms and the terms governing individual models are also absent, so reuse permissions and commercial conditions are unknown from this evidence.

The guide instructs developers not to log API keys, cookies, full task descriptions or full worker outcomes. It also prohibits logging user content unless the product already has an explicit retention policy. It does not establish the service's data retention, training use, residency or confidentiality terms.

freshness

The supplied page was captured on 23 November 2026 at 15:22:26.175 UTC. It does not state a publication or last-updated date. The capture timestamp establishes the document snapshot's date, not the age of the feature or its current operational status.

The tool's beta status, experimental function-tool inheritance, model availability, pricing and invocation limits require current confirmation before implementation. The guide explains that tilde-latest model aliases change their resolved version, while exact model slugs allow explicit version selection. Its example model identifiers do not establish present availability.

actions

Before adopting the pattern, confirm current model tool support, worker prices and subagent limits using the references identified by the guide: [https://openrouter.ai/models] and [https://openrouter.ai/docs/guides/features/server-tools/subagent.md]. Choose rolling aliases or exact model slugs according to how much version change the application can accommodate.

Begin with one bounded task and complete input context. Compare the integrated answer's quality, total cost and latency with the existing workflow before increasing delegation. Configure worker limits, handle worker errors and incomplete streams, and retain routing and usage telemetry without copying task content into logs. These are implementation steps to perform; no such evaluation results are available.

Evidence for this report

selected-page.txtselected · checked 2026-11-23