OpenAI Hosted Shell and Apply Patch: GPT-5.5 Compute Tools for Autonomous Code Execution

OpenAI Hosted Shell and Apply Patch: GPT-5.5 Compute Tools for Autonomous Code Execution

GPT-5.5’s hosted shell and apply_patch tools let you run autonomous coding agents that explore filesystems, execute commands, and apply precise code edits — all inside an OpenAI-managed Debian 12 sandbox with no infrastructure to maintain. What Are OpenAI’s Compute Tools? Hosted Shell and Apply Patch Explained OpenAI’s compute tools are two purpose-built capabilities in the Responses API that give models direct access to code execution environments and structured file-editing primitives. The hosted shell tool provisions an ephemeral Debian 12 container where GPT-5.5 can run arbitrary shell commands — installing packages, running test suites, inspecting file trees, and producing downloadable artifacts via /mnt/data. The apply_patch tool gives the model a structured way to propose file modifications using the V4A diff format, which supports create_file, update_file, and delete_file operations with surgical precision. Together, these two tools form a closed loop: the model explores a codebase with shell commands, identifies what needs to change, and applies those changes via structured patches — without the host application needing to interpret or re-execute diffs. As of April 2026, these tools are only available through the Responses API (not the Chat Completions API) and require GPT-5.5 or compatible models. The combination represents OpenAI’s most direct answer to Claude Code, GitHub Copilot Agent, and similar agentic coding platforms. ...

April 25, 2026 · 16 min · baeseokjae
OpenAI Codex CLI Guide 2026: Terminal AI Coding with the Rust-Built Agent

OpenAI Codex CLI Guide 2026: Terminal AI Coding with the Rust-Built Agent

OpenAI Codex CLI is a terminal-based AI coding agent that reads your codebase, writes and edits files, runs tests, and commits changes — all from your command line. Unlike web-based AI tools, Codex CLI runs locally against your actual repository, understanding real project context rather than a pasted snippet. What Is OpenAI Codex CLI? (The Rust-Built Terminal AI Agent) OpenAI Codex CLI is an open-source, terminal-native AI coding agent that autonomously plans, writes, edits, and tests code within your local development environment. Unlike browser-based AI assistants, Codex CLI reads your entire codebase, executes shell commands, and manages file changes — operating as a true software engineering collaborator rather than a text-completion tool. Rebuilt in Rust as of June 2025 (now 95.6% Rust), the agent starts in milliseconds and consumes a fraction of the memory its Node.js predecessor required. As of April 2026, Codex CLI has surpassed 3 million weekly active users (confirmed by Sam Altman on April 8, 2026), 75,000+ GitHub stars, and 14.53 million npm downloads in March 2026 alone — a 177x increase year-over-year. With 696 releases in 12 months (nearly two per day), it is one of the fastest-evolving developer tools in the AI space. The key differentiator: Codex CLI operates under configurable approval policies, so you control how much autonomy the agent has before touching your files. ...

April 24, 2026 · 16 min · baeseokjae
LLM Prompt Caching Guide 2026: Cut API Costs 70% with Anthropic and OpenAI

LLM Prompt Caching Guide 2026: Cut API Costs 70% with Anthropic and OpenAI

Prompt caching is the single highest-ROI optimization available for production LLM applications. If you run 10,000 requests per day with an 8K-token cached system prompt on Anthropic Claude, you save roughly $576/month — with a few lines of code change. OpenAI’s automatic caching requires zero code changes and gives you a 50% discount on repeated input tokens. Anthropic’s explicit caching offers up to 90% savings. This guide covers both, plus Gemini, with production code examples, real cost numbers, and the anti-patterns that silently destroy your cache hit rate. ...

April 21, 2026 · 16 min · baeseokjae
OpenAI Responses API Tutorial 2026: Build Stateful AI Apps in Python

OpenAI Responses API Tutorial 2026: Build Stateful AI Apps in Python

The OpenAI Responses API is the new primary interface for building stateful, agentic AI applications — replacing the Assistants API (being sunset H1 2026) and extending beyond what Chat Completions can do. This tutorial walks through everything from your first API call to building multi-step agents with built-in tools like web search and file retrieval. What Is the OpenAI Responses API? The OpenAI Responses API is a stateful, tool-native interface for building AI agents and multi-turn applications — launched in March 2025 as OpenAI’s replacement for the Assistants API and a significant evolution beyond Chat Completions. Unlike Chat Completions, which is stateless (every request requires you to resend the full conversation history), Responses API maintains conversation state server-side using previous_response_id. A 10-turn conversation with Chat Completions resends your entire history on turn 10, making it up to 5x more expensive for long dialogues. Responses API sends only the new message each turn — the server already holds context. Built-in tools (web search at $25–50/1K queries, file search at $2.50/1K queries) are first-class citizens rather than custom function definitions, and reasoning tokens from o3 and o4-mini are preserved between turns instead of being discarded. OpenAI has moved all example code in the openai-python repository to Responses API patterns — it is where the platform is going. ...

April 21, 2026 · 18 min · baeseokjae