Shell
openrouter:shell
Gives any model a hosted shell on the Responses and Messages APIs. The model issues commands, OpenRouter runs them in an isolated container, and stdout and stderr are returned to the model. A sandbox-backed equivalent of OpenAI’s hosted shell tool.
How it works
For running code, scripts, and command-line tools. Commands always run in a hosted environment, never on your machine.
Your model sends a batch of commands to run.
OpenRouter runs each one in an isolated Linux container and captures stdout, stderr, and the exit code.
Your model reads the output, and can run more commands in the same request.
Providers and pricing
Commands always run in the OpenRouter sandbox, on every model and provider. The Responses API’s native shell tool is accepted as a shorthand and runs in the same sandbox.
Standard model token costs apply to every request.
Using this tool
OpenRouter runs the tool during the request and returns the result to the model, so no client-side tool loop is needed.
Supported APIs: Responses and Anthropic Messages.
curl https://openrouter.ai/api/v1/responses \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2",
"tools": [
{
"type": "openrouter:shell"
}
],
"input": "Create a Python script that prints the first 20 Fibonacci numbers and run it."
}'Setup, parameters, and examples in the docs.
Read the integration guide