Skip to content
  • Models
  • Rankings
  • Ori
Sign Up
Sign Up
OpenRouterOpenRouter
© 2026 OpenRouter, Inc

Product

  • Chat
  • Rankings
  • Benchmarks
  • Apps
  • Discover
  • Models
  • Collections
  • Providers
  • Tools
  • Pricing
  • Business
  • Enterprise
  • Labs

Company

  • About
  • Blog
  • Careers
    Hiring
  • Privacy
  • Terms of Service
  • Trust Center
  • Support
  • Works With OR
  • Data
  • Brand

Developer

  • Documentation
  • API Reference
  • Developer Platform
  • Status

Connect

  • Discord
  • GitHub
  • LinkedIn
  • X
  • YouTube
All server tools

Shell

openrouter:shell

DocsTry this tool

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.

DocsTry this tool

How it works

For running code, scripts, and command-line tools. Commands always run in a hosted environment, never on your machine.

  1. 1

    Your model sends a batch of commands to run.

  2. 2

    OpenRouter runs each one in an isolated Linux container and captures stdout, stderr, and the exit code.

  3. 3

    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.

  • Favicon for https://openrouter.ai

    OpenRouter sandbox

    $0.0001 / second

    30.0s minimum on requests that start a container

    Commands run server-side in an isolated container operated by OpenRouter.

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.

shell
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

Related tools

Code & execution

  • Apply patch

    Let models propose file edits as V4A diffs

    Code & execution
  • Bash

    Anthropic-style bash tool with optional sandboxed execution

    Code & execution