DEV Community

Alex Spinov
Alex Spinov

Posted on

Open Interpreter Has a Free API — Let AI Control Your Computer

Open Interpreter: ChatGPT That Runs Code on Your Machine

Open Interpreter lets LLMs run code locally. Python, JavaScript, shell commands — the AI writes and executes code on your computer. Like ChatGPT Code Interpreter, but local and unlimited.

Why Open Interpreter

  • No file size limits (unlike ChatGPT)
  • Internet access from code
  • Any package/library available
  • Runs locally — your data stays private
  • Supports multiple LLMs

The Free API

from interpreter import interpreter

# Configure
interpreter.llm.model = "gpt-4o"
# Or use local model:
# interpreter.llm.model = "ollama/llama3"

# Chat
interpreter.chat("Create a bar chart of top 10 programming languages")
# AI writes matplotlib code, executes it, shows the chart

interpreter.chat("Download Bitcoin price data and find the best week to buy")
# AI writes requests + pandas code, runs it, gives analysis

interpreter.chat("Compress all PNG files in ~/Desktop to WebP")
# AI writes a shell script and runs it
Enter fullscreen mode Exit fullscreen mode

Python API

from interpreter import interpreter

interpreter.llm.model = "gpt-4o"
interpreter.auto_run = True  # No confirmation prompts

# Stream responses
for chunk in interpreter.chat("Find large files over 100MB", stream=True):
    if chunk.get("type") == "message":
        print(chunk["content"], end="")
    elif chunk.get("type") == "code":
        print(f"Running: {chunk[content]}")
Enter fullscreen mode Exit fullscreen mode

HTTP Server

# Start as HTTP server
interpreter --server

# Call via API
curl -X POST http://localhost:8000/chat \
  -H "Content-Type: application/json" \
  -d "{\"message\": \"What is my disk usage?\"}"
Enter fullscreen mode Exit fullscreen mode

Real-World Use Case

A data analyst needed to process 500 Excel files with different formats. ChatGPT Code Interpreter: 100MB limit. Open Interpreter: processed all 500 files locally, merged them, created pivot tables, exported to one master spreadsheet. Total: 15 minutes.

Quick Start

pip install open-interpreter
interpreter
Enter fullscreen mode Exit fullscreen mode

Resources


Need automated data processing? Check out my tools on Apify or email spinov001@gmail.com.

Top comments (0)