Bash
openrouter:bash
An Anthropic-style bash tool for the Messages API. With engine set to openrouter, commands run server-side in an isolated container. With auto or native, the tool call is returned to your application for client-side execution.
How it works
For Messages API integrations built on Claude’s bash tool. For sandboxed commands on the Responses API, use Shell.
Your model emits a bash call with the commands to run.
Your app or OpenRouter runs them: your app by default, or the OpenRouter sandbox when engine is openrouter.
Your model reads stdout, stderr, and the exit code, then continues.
Providers and pricing
engine: "openrouter" runs commands in the OpenRouter sandbox. auto and native return the call to your application to execute.
Standard model token costs apply to every request.
Using this tool
With parameters.engine set to openrouter, as in this quick start, OpenRouter runs the commands in its sandbox and returns the output to the model. With the default engine, auto, or with native, the tool call is returned to your application to run client-side.
Available through the API. The chatroom uses Shell, which covers the same sandbox on the Responses API.
Supported APIs: Anthropic Messages.
curl https://openrouter.ai/api/v1/messages \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "~anthropic/claude-opus-latest",
"max_tokens": 1024,
"tools": [
{
"type": "openrouter:bash",
"parameters": {
"engine": "openrouter"
}
}
],
"messages": [
{
"role": "user",
"content": "List the files in the working directory and count the lines in each."
}
]
}'Setup, parameters, and examples in the docs.
Read the integration guide