Python Sandbox

Runs Python 3.11 with a rich scientific stack: NumPy, pandas, matplotlib, scikit-learn, scipy, sympy, and more pre-installed.

Data Analysis

Upload CSV, Excel, or JSON files and let the model clean, transform, analyze, and visualize your data autonomously.

Isolated Execution

Each session runs in a fully isolated container with no network access and automatic cleanup after the session ends.

Sandbox Environment

The Code Interpreter sandbox is a hermetically sealed Python environment. It has no internet access, ensuring that sensitive data never leaves the container. Sessions persist for up to one hour of inactivity.

Property Value
Python version 3.11.x
Memory Up to 4 GB RAM
Disk Up to 10 GB ephemeral storage
CPU Multi-core; no GPU
Network access None (fully isolated)
Session timeout 1 hour after last activity
Max execution time 120 seconds per code cell

Pre-installed Libraries

Data Science

numpy pandas scipy statsmodels sklearn

Visualization

matplotlib seaborn plotly bokeh altair

Math & Utilities

sympy pillow openpyxl pdfplumber jsonschema
Container Types — Use "container": {"type": "auto"} to let GlomaxGPT provision and manage the container lifecycle. You can also provide a pre-created container ID for session continuity across multiple API calls.

File Upload & Download

You can upload files for the model to process, and download generated output files (charts, processed CSVs, reports) via the Files API.

Python — Upload File for Analysis
from GlomaxGPT import GlomaxGPT

client = GlomaxGPT()

# Upload the data file
with open("sales_data.csv", "rb") as f:
    uploaded_file = client.files.create(
        file=f,
        purpose="assistants"
    )

# Use it in a response with Code Interpreter
response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Analyze this sales data. Find the top 5 products by revenue and plot a bar chart.",
    tools=[{
        "type": "code_interpreter",
        "container": {"type": "auto"}
    }],
    tool_resources={
        "code_interpreter": {
            "file_ids": [uploaded_file.id]
        }
    }
)

print(response.output_text)
Python — Download Generated Files
from GlomaxGPT import GlomaxGPT

client = GlomaxGPT()

response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Generate a line chart of y = sin(x) from 0 to 4π and save it as a PNG.",
    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}]
)

# Find file output items in the response
for item in response.output:
    if item.type == "code_interpreter_call":
        for output in item.outputs:
            if output.type == "files":
                for file_ref in output.files:
                    print(f"Generated file ID: {file_ref.file_id}")
                    # Download the file content
                    content = client.files.content(file_ref.file_id)
                    with open(f"output_{file_ref.file_id}.png", "wb") as out:
                        out.write(content.read())
Python — Multiple Files
from GlomaxGPT import GlomaxGPT

client = GlomaxGPT()

file_names = ["q1_sales.csv", "q2_sales.csv", "q3_sales.csv"]
file_ids = []

for name in file_names:
    with open(name, "rb") as f:
        uploaded = client.files.create(file=f, purpose="assistants")
        file_ids.append(uploaded.id)

response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Compare Q1, Q2, and Q3 sales. Which quarter had the highest growth? Show a trend chart.",
    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}],
    tool_resources={
        "code_interpreter": {"file_ids": file_ids}
    }
)

print(response.output_text)

Örnekler

1

Data Analysis

Ask the model to load a CSV, compute statistics, identify outliers, and summarize findings in plain language.

Python
response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Load the CSV, compute descriptive statistics for all numeric columns, identify any outliers using IQR, and give me a summary.",
    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}],
    tool_resources={"code_interpreter": {"file_ids": ["file-abc123"]}}
)
2

Mathematical Computation

Solve complex equations, perform linear algebra, compute integrals, or run simulations.

Python
response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Solve the system of equations: 3x + 2y - z = 7, x - y + 2z = -2, 2x + y - 3z = 12. Show your work step by step.",
    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}]
)
3

Chart Generation

Generate publication-quality charts and graphs. The model writes matplotlib or seaborn code and returns image file IDs.

Python
response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Create a heatmap showing monthly revenue by product category for the past year using a seaborn color gradient.",
    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}],
    tool_resources={"code_interpreter": {"file_ids": ["file-revenue-data"]}}
)
4

File Conversion

Convert between file formats: JSON to CSV, Markdown to HTML, Excel to parquet, images to different formats, and more.

Python
response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Convert this Excel file to a clean CSV, remove the header rows that are metadata, and output only the data table.",
    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}],
    tool_resources={"code_interpreter": {"file_ids": ["file-excel-report"]}}
)

Handling Outputs

Code Interpreter produces several output types. Inspect the response output array to handle each type appropriately.

Python — Full Output Handling
from GlomaxGPT import GlomaxGPT
import json

client = GlomaxGPT()

response = client.responses.create(
    model="glomaxgpt-ultra",
    input="Analyze the dataset and generate a summary chart.",
    tools=[{"type": "code_interpreter", "container": {"type": "auto"}}],
    tool_resources={"code_interpreter": {"file_ids": ["file-abc123"]}}
)

for item in response.output:
    if item.type == "code_interpreter_call":
        print("=== Code executed ===")
        print(item.code)
        print("=== Outputs ===")
        for output in item.outputs:
            if output.type == "logs":
                # stdout / stderr from code execution
                print(f"Logs: {output.logs}")
            elif output.type == "files":
                # Image or file output
                for file_ref in output.files:
                    print(f"File ID: {file_ref.file_id}, MIME: {file_ref.mime_type}")
    elif item.type == "message":
        # Natural language summary from the model
        print("=== Model response ===")
        print(response.output_text)

Fiyatlar

Code Interpreter session (per hour) $0.03 / session
Input tokens (standard model rates apply) See Fiyatlar
Generated file storage (per day) $0.10 / GB
Session Billing — A session is billed per hour of container uptime, not per API call. If you make 10 calls within the same hour using the same container, you are only billed once. Container IDs can be reused across calls for session continuity.

Sonraki Adımlar

Combine Code Interpreter with File Search to analyze your company documents — search for relevant data with File Search and run calculations with Code Interpreter in the same response.