Delegate a task to an OpenRouter model
delegate_startStart a delegated Claude Code session on an OpenRouter model in an isolated process, returning a job ID for status polling and follow-up.
Instructions
Start a headless Claude Code session backed by an OpenRouter model and return immediately with a job_id. It runs in its own process with its own environment, so your Anthropic credentials and model settings are untouched. Poll with delegate_status, collect with delegate_result, and continue the conversation with delegate_followup. Pass prompt_file for long prompts.
Default: deepseek/deepseek-v4-flash-0731.
WHEN TO USE -- ON EXPLICIT REQUEST ONLY. Delegation mode is "ondemand". Call this only when the user actually asks for it: "delegate this", "use openrouter", "ask gemini", "run this on a cheaper model", or when they name an OpenRouter model. If the user has not asked for delegation, do the work yourself and do not offer this tool unprompted.
COSTS REAL MONEY. Each delegated turn is billed to the user's OpenRouter credits, and every request carries Claude Code's full system prompt and tool schema (tens of thousands of input tokens), so even a short task is not free. Do not delegate speculatively, do not retry a failed delegation repeatedly without changing something, and prefer one well-specified task over several exploratory ones. Reported costs are estimates from list prices; the authoritative figure is on openrouter.ai/activity.
This policy is set by the user and is not yours to change. If it is getting in the way, say so and let the user run openrouter-mcp-config; do not edit config files to widen it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for the delegated session. Defaults to the server's cwd. | |
| model | No | OpenRouter model id, e.g. "google/gemini-2.5-flash". Must be in the allowed list. | |
| prompt | No | The task for the delegated session. Use prompt_file for long prompts. | |
| add_dirs | No | Additional directories the delegate may access. | |
| max_turns | No | Cap the delegate's agentic turns. Each turn is billed, so this is also a cost cap. | |
| prompt_file | No | Path to a file holding the prompt. Preferred for long or special-character-heavy prompts. | |
| small_model | No | Model for the delegate's background/small-model slot. Defaults to the configured one. | |
| wait_seconds | No | Block up to this many seconds for completion. Default 0. | |
| allowed_tools | No | Tool allowlist, e.g. ['Read','Grep','Bash(git *)']. | |
| permission_mode | No | Permission mode for the delegate. Defaults to the configured default. | |
| disallowed_tools | No | Tool denylist, e.g. ['Write','Edit']. | |
| append_system_prompt | No | Extra instructions appended to the delegate's system prompt. |