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.
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
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/shell-openai-api-workflow-guide.md | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | Shell 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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.text | A 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
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - 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
