OpenRouter Shell Tool: Any Model Gets a Hosted Linux Sandbox at $0.0001 Per Second
OpenRouter shipped a shell server tool and Files API on September 8, making it possible to give any model on the platform a hosted Linux shell without standing up local compute. The capability is available on the Responses and Messages APIs, currently in beta.
How It Works
The shell tool adds a bash tool to the model’s context. The model issues shell commands; they execute in an isolated container; stdout, stderr, and exit codes come back as tool results. Files the run writes to disk can be retrieved afterward through the Files API.
Containers are isolated per-request by default. An agent making multiple sequential requests can reuse the same container if it explicitly maintains the container ID across turns — otherwise each request starts fresh.
The Files API handles input and output: upload a file before the run, read back what the model wrote after. Storage is limited to 10GB total across all files; there is no per-file size limit stated. Files API usage has no separate charge beyond storage.
Pricing
Sandbox time billing:
| Condition | Rate |
|---|---|
| Active seconds (model running commands) | $0.0001/sec |
| Minimum per cold-start | 30 sec ($0.003) |
| Idle time after request ends | Not billed |
For a simple tool call that runs three shell commands over 45 seconds of active compute, the sandbox cost is $0.0045. Token costs are separate and standard for the model used.
The 30-second minimum applies on cold container starts. Warm reuse avoids the minimum. In practice, agents making multiple requests in rapid succession against the same container pay the minimum only on the first request.
What This Enables
The primary use case is coding agents and research agents that need to execute code, run tests, or interact with a filesystem without the overhead of managing a local sandbox environment. Before this feature, achieving the same result required either:
- A locally hosted execution environment (compute cost, infra overhead)
- A cloud VM provisioned per run (slower, more expensive at low volume)
- A managed code execution product with narrower model compatibility
The OpenRouter shell tool makes the execution environment a per-request line item, billed at the same granularity as tokens. It also makes the capability available across every model on the platform — not just the models with native code execution support from the originating lab.
For GPT-5.5, DeepSeek V4 Flash, Kimi K3, and other models that don’t have lab-native sandboxed execution, the shell tool fills that gap through the OpenRouter layer.
Positioning Against Lab-Native Execution
OpenAI has its own code interpreter tool for ChatGPT and the API. Google offers code execution in the Gemini API. Both are model-specific. The OpenRouter shell tool works the same way regardless of which model is selected, and switching models doesn’t require changing the tool integration.
The $0.0001/second rate works out to $0.36 per hour of active compute. For short-burst agentic tasks — running a test suite, executing a data transform, checking a file — costs stay under a cent per run. For long-running processes that keep the container active, the rate is meaningful and operators should time-bound agent runs accordingly.
The beta flag means pricing and API shape may change. OpenRouter is asking users to report unexpected behavior in their Discord before the API solidifies.