Skip to main content

Code Interpreter (OpenAI)

The Code Interpreter (OpenAI) tool (openai_code_interpreter) is a native feature from OpenAI that allows the model to write and execute Python code in a secure sandbox environment. This is powerful for data analysis, calculations, and generating visualizations.

Only in assistants, lessons and workflows

Code execution is always off in standard chats, even if the environment or your personal settings say otherwise. Switch the tool on in the tool settings of an assistant, lesson or workflow that needs calculations or file editing. Code execution can take longer and add costs.

How It Works​

The Code Interpreter enables the AI model to write and directly execute Python code. The model can process files, perform calculations, create graphs, and analyze data - all within a safe, isolated environment.

Settings​

SettingValue
Tool keyopenai_code_interpreter
Default statusDisabled
Available forSuitable OpenAI models and newer

Capabilities​

Data Analysis​

  • Process CSV and Excel files
  • Perform statistical analyses
  • Identify trends and patterns

Visualizations​

  • Create graphs and charts
  • Generate interactive plots
  • Visualize data

Calculations​

  • Complex mathematical calculations
  • Scientific formulas
  • Financial models

File Processing​

  • Read and summarize PDFs
  • Edit images
  • Transform data

Usage Examples​

  • "Analyze this CSV with sales figures and create a graph"
  • "Calculate the standard deviation of this dataset"
  • "Convert this Excel data to a bar chart"
  • "Solve this system of equations and show the steps"

Security​

The Code Interpreter runs in a sandbox environment:

  • ✅ No internet access from the sandbox
  • ✅ No access to external systems
  • ✅ Limited execution time
  • ✅ Limited resources

Limitations​

  • Only available with OpenAI models
  • Maximum file size for uploads
  • Limited library support (no arbitrary pip installs)
  • Sessions are temporary - files are not saved