Python 88.3%
TypeScript 7.6%
Shell 4.1%
1// Code interpreter (auto container) then GET/LIST/DELETE the container. STATUS: LIVE_VERIFIED 2026-09-18 (gpt-5.4-nano). $0.03/session (1g).2// Run: node --env-file=.env --experimental-strip-types examples/openai/tools/code-interpreter/code_interpreter.ts3import OpenAI from "openai";4import { logRequest } from "../../../shared/tool-loop/log.ts";5const client = new OpenAI();6const r: any = await client.responses.create({ model: "gpt-5.4-nano", input: "Run print(2+2) in python and reply with just the number.",7 tools: [{ type: "code_interpreter", container: { type: "auto" } }], tool_choice: { type: "code_interpreter" }, include: ["code_interpreter_call.outputs"], max_output_tokens: 400, reasoning: { effort: "low" } });8logRequest("openai", "POST", "/v1/responses", 200, 0.03, "code_interpreter.ts");9const ci = r.output.find((i: any) => i.type === "code_interpreter_call");10console.log("code:", ci.code, "outputs:", JSON.stringify(ci.outputs), "answer:", r.output_text);11const c = await client.containers.retrieve(ci.container_id); logRequest("openai", "GET", "/v1/containers/{id}", 200, 0, "code_interpreter.ts retrieve");12console.log("container:", c.id, c.status, (c as any).memory_limit, JSON.stringify(c.expires_after));13const files = await client.containers.files.list(ci.container_id); logRequest("openai", "GET", "/v1/containers/{id}/files", 200, 0, "code_interpreter.ts files");14console.log("files:", files.data.map((x: any) => x.path));15await client.containers.delete(ci.container_id); logRequest("openai", "DELETE", "/v1/containers/{id}", 200, 0, "code_interpreter.ts delete");16console.log("deleted");17