Python 88.3%
TypeScript 7.6%
Shell 4.1%
1// computer_use_preview + computer-use-preview model with a 1x1 PNG screenshot. STATUS: ACCOUNT_RESTRICTED 2026-09-18 (404 model_not_found with our key).2// Run: node --env-file=.env --experimental-strip-types examples/openai/tools/computer-use/computer_use.ts3import OpenAI from "openai";4import { logRequest } from "../../../shared/tool-loop/log.ts";5const client = new OpenAI();6const PNG1 = Buffer.from("89504e470d0a1a0a0000000d49484452000000010000000108060000001f15c4890000000d4944415478da63f8ffff3f03000500020a2c2d3e850000000049454e44ae426082", "hex").toString("base64");7try {8 const r: any = await client.responses.create({ model: "computer-use-preview", truncation: "auto", max_output_tokens: 32,9 tools: [{ type: "computer_use_preview", display_width: 1, display_height: 1, environment: "browser" }],10 input: [{ role: "user", content: [{ type: "input_text", text: "Do nothing. Reply with OK." }, { type: "input_image", image_url: `data:image/png;base64,${PNG1}`, detail: "auto" }] }] });11 logRequest("openai", "POST", "/v1/responses", 200, 0.001, "computer_use.ts");12 console.log(r.output.map((i: any) => i.type));13} catch (e: any) {14 logRequest("openai", "POST", "/v1/responses", e.status ?? 0, 0, "computer_use.ts restricted");15 console.log(`HTTP ${e.status}:`, JSON.stringify(e.error));16}17