跳转到内容
Alpha
  • 模型
  • 排行榜
  • Ori
联系销售

页脚

OpenRouterOpenRouter
© 2026 OpenRouter, Inc

产品

  • 聊天
  • 排行榜
  • 基准测试
  • 应用
  • 发现
  • 模型
  • Ori
  • 合集
  • 提供商
  • 工具
  • 定价
  • Business
  • Enterprise
  • 实验室

公司

  • 关于
  • 博客
  • 客户
  • 招聘
    招聘
  • 隐私
  • 服务条款
  • 信任中心
  • 支持
  • 兼容 OR
  • 数据
  • 品牌

开发者

  • 文档
  • API 参考
  • 开发者平台
  • 状态
  • AI 站点地图

连接

  • Discord
  • GitHub
  • LinkedIn
  • X
  • YouTube
所有服务器工具

Shell

openrouter:shell

文档试用此工具

通过 Responses 和 Messages API 为任何模型提供托管 shell。模型发出命令,OpenRouter 在隔离容器中运行命令,并将 stdout 和 stderr 返回给模型。这是基于沙箱的 OpenAI 托管 shell 工具等效实现。

文档试用此工具
工作原理提供商和定价使用此工具常见问题相关工具

工作原理

用于运行代码、脚本和命令行工具。命令始终在托管环境中运行,绝不会在您的机器上运行。

  1. 1

    您的模型 发送一批待执行的命令。

  2. 2

    OpenRouter 在隔离的 Linux 容器中运行每一项,并捕获 stdout、stderr 和退出码。

  3. 3

    您的模型 读取输出,并可在同一请求中运行更多命令。

提供商与定价

无论使用哪个模型或提供商,命令始终在 OpenRouter 沙箱中运行。Responses API 的原生 shell 工具可作为简写形式使用,并在同一沙箱中运行。

  • https://openrouter.ai 的网站图标

    OpenRouter sandbox

    US$0.0001 / second

    启动容器的请求最低按 30.0s 计费

    命令在服务端由 OpenRouter 运营的隔离容器中运行。

每个请求均按标准模型 token 费用计费。

使用此工具

OpenRouter 在请求期间运行工具并将结果返回给模型,因此无需客户端工具循环。

支持的 API: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."
}'

文档中提供了设置、参数和示例。

阅读集成指南

常见问题

Shell follows the Responses API hosted shell shape and works on the Responses and Messages APIs. Bash follows the Anthropic bash tool shape and is only available on the Anthropic Messages API.

相关工具

代码与执行

  • Apply patch

    Let models propose file edits as V4A diffs

    代码与执行
  • Bash

    Anthropic-style bash tool with optional sandboxed execution

    代码与执行