Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Code Interpreter | OpenAI API

Explains how to integrate the Code Interpreter tool into an OpenAI API implementation to enable the model to write and execute Python code for data analysis and mathematical reasoning.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Code Interpreter | OpenAI API

Explains how to integrate the Code Interpreter tool into an OpenAI API implementation to enable the model to write and execute Python code for data analysis and mathematical reasoning.

When To Use

Use when you need to enable an AI agent to perform complex mathematical calculations, data visualization, or execute Python code to solve computational problems.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/interpreter-openai-api-workflow-guide.mdA guide explaining how to use the Code Interpreter tool to run Python code in a sandboxed environment for data analysis and math.Questions about a guide explaining how to use the Code Interpreter tool to run Python code in a sandboxed environment for data analys...
examples/interpreter-openai-api-openai-api-interpreter-curl-request.textA 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 curl command demonstrating how to send a request to the OpenAI API with the code interpreter tool enabled.
examples/interpreter-openai-api-openai-api-interpreter-nodejs-math-tutor.textA Node.js code example demonstrating how to initialize the OpenAI client and use the code interpreter tool to act as a math tutor.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to initialize the OpenAI client and use the code interpreter tool to act as...
examples/interpreter-openai-api-openai-api-interpreter-python-math-tutor.textA Python script demonstrating how to initialize the OpenAI client and use the code interpreter tool to act as a math tutor.Exact payloads, commands, or snippets shown in A Python script demonstrating how to initialize the OpenAI client and use the code interpreter tool to act as a math...
examples/interpreter-openai-api-openai-api-interpreter-container-creation-curl.textA curl command demonstrating how to create a new container with a specified name and memory limit via the OpenAI API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to create a new container with a specified name and memory limit via the OpenAI API.
examples/interpreter-openai-api-openai-api-interpreter-python-container-creation.textA Python script demonstrating how to create a container and use the code interpreter tool 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 via the OpenAI API.
examples/interpreter-openai-api-openai-api-interpreter-nodejs-container-creation.textA Node.js code example demonstrating how to create a container and initiate a response using the Code Interpreter tool via the OpenAI API.Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to create a container and initiate a response using the Code Interpreter too...
examples/interpreter-openai-api-openai-api-interpreter-message-response.textA JSON representation of an API message response containing annotations and file citations for the Code Interpreter tool.Exact payloads, commands, or snippets shown in A JSON representation of an API message response containing annotations and file citations for the Code Interpreter t...

What This Skill Covers

  • The Code Interpreter tool allows models to write and run Python code in a sandboxed environment to solve complex problems in domains like data analysis, codi...
  • 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