Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Shell | OpenAI API

Explains how to implement and use the Shell tool within the OpenAI API to allow models to execute commands in a secure, sandboxed environment.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Shell | OpenAI API

Explains how to implement and use the Shell tool within the OpenAI API to allow models to execute commands in a secure, sandboxed environment.

When To Use

Use when you need to enable an AI agent to perform system-level tasks, execute code, or interact with a command-line interface through tool calling.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/shell-openai-api-workflow-guide.mdA guide explaining how the shell tool allows models to execute commands in local or hosted terminal environments via the Responses API.Questions about a guide explaining how the shell tool allows models to execute commands in local or hosted terminal environments via...
examples/shell-openai-api-openai-api-shell-tool-curl-request.textA curl command demonstrating how to call the OpenAI API to use the shell tool with a containerized environment.Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API to use the shell tool with a containerized environment.
examples/shell-openai-api-openai-api-shell-tool-nodejs.textA Node.js code example demonstrating how to use the OpenAI API shell tool to execute commands in a containerized environment.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI API shell tool to execute commands in a containerized envi...
examples/shell-openai-api-openai-api-python-shell-tool-execution.textA Python script demonstrating how to use the OpenAI API to execute shell commands within a containerized environment using the shell tool.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI API to execute shell commands within a containerized environment...
examples/shell-openai-api-openai-api-shell-curl-container-creation.textA curl command demonstrating how to create a new container using the OpenAI API via a shell request.Exact payloads, commands, or snippets shown in A curl command demonstrating how to create a new container using the OpenAI API via a shell request.
examples/shell-openai-api-openai-api-shell-container-create-nodejs.textA Node.js code snippet demonstrating how to create a new analysis container using the OpenAI API client.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to create a new analysis container using the OpenAI API client.
examples/shell-openai-api-openai-api-python-container-creation.textA Python script demonstrating how to use the OpenAI client to create a new container with specific memory limits and expiration settings.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to create a new container with specific memory limits and...
examples/shell-openai-api-openai-api-shell-tool-curl-request-2.textA curl command demonstrating how to call the OpenAI API using the shell tool type with a container reference.Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API using the shell tool type with a container reference.
examples/shell-openai-api-openai-api-shell-tool-container-execution.textA JavaScript code snippet demonstrating how to use the OpenAI API shell tool to execute commands within a specific container environment.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use the OpenAI API shell tool to execute commands within a specific co...
examples/shell-openai-api-openai-api-shell-tool-python-container-execution.textA Python script demonstrating how to use the OpenAI API shell tool to execute commands within a specified container environment.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI API shell tool to execute commands within a specified container e...
examples/shell-openai-api-openai-api-shell-curl-container-creation-2.textA curl command demonstrating how to create a skill container using the OpenAI API via a shell request.Exact payloads, commands, or snippets shown in A curl command demonstrating how to create a skill container using the OpenAI API via a shell request.
examples/shell-openai-api-openai-api-shell-container-create-nodejs-2.textA Node.js code snippet demonstrating how to create a container with specific skill references using the OpenAI client.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to create a container with specific skill references using the OpenAI client.
examples/shell-openai-api-openai-api-python-skill-container-creation.textA Python script demonstrating how to create a skill container using the OpenAI client library.Exact payloads, commands, or snippets shown in A Python script demonstrating how to create a skill container using the OpenAI client library.
examples/shell-openai-api-openai-api-shell-tool-curl-request-3.textA curl command demonstrating how to call the OpenAI API with the shell tool enabled and a required tool choice.Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API with the shell tool enabled and a required tool choice.
examples/shell-openai-api-openai-api-shell-tool-nodejs-2.textA Node.js code example demonstrating how to use the OpenAI API to call a shell tool with a containerized environment.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI API to call a shell tool with a containerized environment.
examples/shell-openai-api-openai-api-python-shell-tool-usage.textA Python script demonstrating how to use the OpenAI API to call a shell tool with a containerized environment.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI API to call a shell tool with a containerized environment.
examples/shell-openai-api-openai-api-shell-container-management-commands.textShell commands for encoding files to base64 and interacting with the OpenAI containers API endpoint.Exact payloads, commands, or snippets shown in Shell commands for encoding files to base64 and interacting with the OpenAI containers API endpoint.
examples/shell-openai-api-openai-api-shell-upload.textA shell-based example demonstrating how to encode local files into base64 for uploading via the OpenAI API.Exact payloads, commands, or snippets shown in A shell-based example demonstrating how to encode local files into base64 for uploading via the OpenAI API.
examples/shell-openai-api-openai-api-python-upload-base64.textA Python script demonstrating how to encode a file into a base64 string for uploading to the OpenAI API.Exact payloads, commands, or snippets shown in A Python script demonstrating how to encode a file into a base64 string for uploading to the OpenAI API.
examples/shell-openai-api-openai-api-shell-delete-container-curl.textA curl command demonstrating how to delete a specific container using the OpenAI API via a shell request.Exact payloads, commands, or snippets shown in A curl command demonstrating how to delete a specific container using the OpenAI API via a shell request.
examples/shell-openai-api-openai-api-shell-client-delete-container.textA JavaScript code snippet demonstrating how to use the OpenAI client to delete a specific container via the API.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to use the OpenAI client to delete a specific container via the API.
examples/shell-openai-api-openai-api-python-container-delete.textA Python script demonstrating how to use the OpenAI client to delete a specific container by its ID.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI client to delete a specific container by its ID.
examples/shell-openai-api-openai-api-shell-curl-request.textA curl command demonstrating how to make a POST request to the OpenAI API using a bearer token and JSON payload.Exact payloads, commands, or snippets shown in A curl command demonstrating how to make a POST request to the OpenAI API using a bearer token and JSON payload.
examples/shell-openai-api-openai-api-shell-tool-usage.textA shell command example demonstrating how to use the OpenAI API to instruct a model to execute a curl request via a tool.Exact payloads, commands, or snippets shown in A shell command example demonstrating how to use the OpenAI API to instruct a model to execute a curl request via a t...
examples/shell-openai-api-openai-api-python-shell-tool-usage-2.textA Python script demonstrating how to use the OpenAI API to instruct a model to execute shell commands via curl.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI API to instruct a model to execute shell commands via curl.
examples/shell-openai-api-openai-api-shell-tool-curl-request-4.textA curl command demonstrating how to call the OpenAI API to use the shell tool with a specific model and environment configuration.Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API to use the shell tool with a specific model and environment c...
examples/shell-openai-api-openai-api-shell-tool-nodejs-response-creation.textA Node.js code example demonstrating how to create a response using the OpenAI API with the shell tool enabled.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a response using the OpenAI API with the shell tool enabled.
examples/shell-openai-api-openai-api-python-shell-tool-execution-2.textA Python script demonstrating how to use the OpenAI API to call a shell tool within a containerized environment.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI API to call a shell tool within a containerized environment.
examples/shell-openai-api-openai-api-shell-tool-call.textA text example demonstrating the JSON structure for a shell tool call within the OpenAI API.Exact payloads, commands, or snippets shown in A text example demonstrating the JSON structure for a shell tool call within the OpenAI API.
examples/shell-openai-api-openai-api-shell-tool-curl-request-5.textA curl command demonstrating how to call the OpenAI API to execute a local shell tool command.Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the OpenAI API to execute a local shell tool command.
examples/shell-openai-api-openai-api-python-shell-tool-usage-3.textA Python script demonstrating how to use the OpenAI API with the shell tool to execute local bash commands.Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI API with the shell tool to execute local bash commands.
examples/shell-openai-api-openai-api-shell-tool-nodejs-3.textA Node.js code example demonstrating how to use the OpenAI API shell tool to execute commands in a local environment.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI API shell tool to execute commands in a local environment.
examples/shell-openai-api-openai-api-shell-executor-python-implementation.textA Python implementation of a ShellExecutor class designed to run shell commands and capture their output, error, and exit codes.Exact payloads, commands, or snippets shown in A Python implementation of a ShellExecutor class designed to run shell commands and capture their output, error, and...
examples/shell-openai-api-openai-api-shell-executor-javascript-class.textA JavaScript class implementation of a ShellExecutor designed to run shell commands with timeout support.Exact payloads, commands, or snippets shown in A JavaScript class implementation of a ShellExecutor designed to run shell commands with timeout support.
examples/shell-openai-api-openai-api-shell-call-format.textA text representation of the shellcalloutput JSON structure used in the OpenAI API.Exact payloads, commands, or snippets shown in A text representation of the shellcalloutput JSON structure used in the OpenAI API.
examples/shell-openai-api-openai-api-shell-local-implementation-typescript.textA TypeScript implementation of a LocalShell class that defines the run method for executing shell actions.Exact payloads, commands, or snippets shown in A TypeScript implementation of a LocalShell class that defines the run method for executing shell actions.
examples/shell-openai-api-openai-api-shell-tool-python-implementation.textA Python class implementation of a LocalShell tool for executing shell commands within an agentic workflow.Exact payloads, commands, or snippets shown in A Python class implementation of a LocalShell tool for executing shell commands within an agentic workflow.

What This Skill Covers

  • The shell tool gives models the ability to work inside a complete terminal environment. We support shell for local execution and for hosted execution through...
  • Main sections: Hosted shell quickstart, Hosted runtime details, Reuse a container across requests, 1. Create a container, 2. Reference the container in Responses.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.openai.com/api/docs/guides/tools-shell