Skip to content

Code interpreter

Code execution in sandbox: the tool format and current status on the platform.

Updated on Aug 10, 2026

The code interpreter allows the assistant to write and execute code in an isolated environment — process data files, generate graphs, solve math and logic problems by iterating until the code runs.

Status: accepted for compatibility

The code_interpreter type is accepted in tools — payloads and SDKs from OpenAI do not break — but sandbox execution is still not enabled: the model responds without executing code. Execution is in development; this page documents the format that is valid today and will be valid when enabled.

How to enable

curl -s https://api.hinow.ai/v1/assistants \
  -H "Authorization: Bearer hi_SUA_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "model": "hinow/himax",
    "name": "Cientista de dados",
    "instructions": "Quando precisar de cálculo ou análise de dados, escreva e execute código.",
    "tools": [{"type": "code_interpreter"}]
  }'

Passing files

Files are submitted like other resources — POST /v1/files with purpose=assistants — and are referenced in tool_resources.code_interpreter.file_ids on the assistant (available in all runs) or attached to a message via attachments (available in that thread).

In the meantime

Need code execution today? Function calling covers the case with full control: describe a run_python function (or your preferred runtime), execute in your environment when the run stops at requires_action, and return the result — the assistant incorporates the output into the response as it would with the native interpreter.