Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Code Interpreter

Teaches how to implement and configure the Code Interpreter tool, including managing sandboxed containers via auto and explicit modes, handling file uploads/downloads, and setting memory limits.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Code Interpreter

Teaches how to implement and configure the Code Interpreter tool, including managing sandboxed containers via auto and explicit modes, handling file uploads/downloads, and setting memory limits.

When To Use

Use when you need to enable a model to perform data analysis, execute Python code in a sandbox, or manage file-based workflows using specific memory configurations.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/interpreter-workflow-guide.mdA guide explaining how the Code Interpreter tool uses sandboxed virtual machine containers to execute Python code and manage uploaded files.Questions about a guide explaining how the Code Interpreter tool uses sandboxed virtual machine containers to execute Python code and...
examples/interpreter-openai-interpreter-curl-request.bashA bash curl command demonstrating how to send a request to the OpenAI API with the code interpreter tool enabled.Exact payloads, commands, or snippets shown in A bash curl command demonstrating how to send a request to the OpenAI API with the code interpreter tool enabled.
examples/interpreter-openai-interpreter-javascript-client-setup.javascriptA JavaScript implementation demonstrating how to initialize the OpenAI client and configure the code interpreter tool within a responses request.Exact payloads, commands, or snippets shown in A JavaScript implementation demonstrating how to initialize the OpenAI client and configure the code interpreter tool...
examples/interpreter-openai-interpreter-python-client-setup.pythonA Python script demonstrating how to initialize the OpenAI client and configure the code interpreter tool with specific instructions and container settings.Exact payloads, commands, or snippets shown in A Python script demonstrating how to initialize the OpenAI client and configure the code interpreter tool with specif...
examples/interpreter-openai-interpreter-container-creation-curl.bashA bash script demonstrating how to create a new container using the OpenAI Code Interpreter API via curl requests.Exact payloads, commands, or snippets shown in A bash script demonstrating how to create a new container using the OpenAI Code Interpreter API via curl requests.
examples/interpreter-openai-interpreter-python-container-creation.pythonA Python script demonstrating how to create a container and use the Code Interpreter tool to perform mathematical calculations via the OpenAI API.Exact payloads, commands, or snippets shown in A Python script demonstrating how to create a container and use the Code Interpreter tool to perform mathematical cal...
examples/interpreter-openai-interpreter-javascript-container-creation.javascriptA JavaScript example demonstrating how to create a container and use the Code Interpreter tool with the OpenAI client.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to create a container and use the Code Interpreter tool with the OpenAI client.
examples/interpreter-openai-interpreter-message-annotation.jsonA JSON object demonstrating the structure of message annotations and file citations within a Code Interpreter response.Exact payloads, commands, or snippets shown in A JSON object demonstrating the structure of message annotations and file citations within a Code Interpreter response.

What This Skill Covers

  • The Code Interpreter tool requires a container object. A container is a fully sandboxed virtual machine that the model can run Python code in. This container...
  • Main sections: Containers, Expiration, Work with files, Uploading and downloading files, Dealing with citations.

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-code-interpreter.md