OpenAI Agents SDK Tutorial 2026: Build Multi-Agent Pipelines in Python

OpenAI Agents SDK Tutorial 2026: Build Multi-Agent Pipelines in Python

The OpenAI Agents SDK lets you build production-grade multi-agent pipelines in Python with fewer than 100 lines of core logic. Install it with pip install openai-agents, define agents with instructions and tools, connect them via handoffs or an orchestrator, and run with asyncio. This tutorial walks through a complete three-agent pipeline from setup to deployment. What Is the OpenAI Agents SDK and Why Does It Matter in 2026? The OpenAI Agents SDK is an open-source Python framework that provides four production-grade primitives — Agents, Handoffs, Guardrails, and Tracing — for building multi-step AI workflows without the boilerplate overhead of earlier frameworks. Released in early 2026 and reaching version 0.13.4 in April with full MCP server support, the SDK emerged as a response to a clear market need: 57% of organizations now deploy agents for multi-stage workflows, yet most teams were still stitching together ad-hoc pipelines using raw LLM calls and custom orchestration code. The SDK abstracts that complexity into composable primitives where each Agent is a configuration object wrapping an LLM with instructions, tool access, and optional output schemas. Handoffs allow agents to delegate work to peers; Guardrails validate inputs and outputs; Tracing captures every decision step for debugging and observability. The SDK is also model-agnostic — it supports any provider conforming to the chat completions API format, and integrates with 100+ LLMs via LiteLLM. For teams evaluating agentic frameworks in 2026, the SDK’s minimal surface area and tight OpenAI integration make it the fastest path from prototype to production. ...

April 27, 2026 · 14 min · baeseokjae
LLM Function Calling and Tool Use Guide 2026

LLM Function Calling and Tool Use Guide 2026: OpenAI, Anthropic, Google

Function calling is the bridge between a language model’s text output and the real world. Instead of asking a model to guess what the weather is, you hand it a get_weather tool definition, and it decides when to call it, what arguments to pass, and how to incorporate the result. As of 2026, every major provider—OpenAI, Anthropic, and Google—supports this pattern, but the APIs look meaningfully different. This guide walks through each one with working Python code and covers parallel calls, agent loops, security, and how to pick the right approach. ...

April 27, 2026 · 19 min · baeseokjae
OpenAI Computer Use API Developer Guide 2026

OpenAI Computer Use API Developer Guide 2026: Build Browser Automation Agents

The OpenAI Computer Use API lets you build agents that see a screen, click, type, and navigate web browsers — all through a single API call. This guide walks you through every implementation option, from a 20-line quickstart to production-grade sandboxed agents. What Is the OpenAI Computer Use API? The OpenAI Computer Use API is a capability within the Responses API that lets the computer-use-preview model observe screenshots, interpret UI elements, and emit structured actions (click, type, scroll, keypress) to control a computer or browser. Unlike traditional automation libraries like Selenium or Playwright that require explicit CSS selectors or XPath queries, Computer Use reasons visually about any interface — it reads pixel-level screenshots and decides what to interact with next. OpenAI first released computer-use-preview in early 2026, following Anthropic’s lead with Claude’s computer use. As of April 2026, OpenAI’s API processes over 15 billion tokens per minute, and the computer use capability has become a foundation for autonomous QA testing, data extraction pipelines, and RPA replacement use cases. The model supports screenshots up to 10,240,000 pixels (using detail: "original"), with optimal resolutions of 1440×900 or 1600×900 for desktop environments. The core workflow is a loop: capture screenshot → send to model → receive action → execute action → repeat until task completes. ...

April 26, 2026 · 11 min · baeseokjae
ChatGPT Workspace Agents (Codex-Powered): Team Guide 2026

ChatGPT Workspace Agents (Codex-Powered): Team Guide 2026

ChatGPT Workspace Agents are autonomous AI workers powered by Codex that your team builds once and runs continuously — reading files, calling APIs, posting to Slack, updating Salesforce, and completing multi-step workflows without hand-holding. Launched April 22, 2026, they replace custom GPTs for Business and Enterprise users. What Are ChatGPT Workspace Agents? (Powered by Codex) ChatGPT Workspace Agents are cloud-hosted autonomous AI workers that use OpenAI’s Codex model as their execution engine. Unlike chatbots that respond to a single prompt and stop, workspace agents can plan multi-step workflows, call connected tools (Slack, Google Workspace, Salesforce, Notion), write and run code, retain memory across sessions, and continue working in the background until a task is complete. Launched on April 22, 2026, they represent OpenAI’s clearest enterprise pivot to date: from conversational AI to operational AI. ...

April 26, 2026 · 17 min · baeseokjae
GPT-5.5 Batch API and Flex Mode: 50% Cost Savings for High-Volume AI Coding Tasks

GPT-5.5 Batch API and Flex Mode: 50% Cost Savings for High-Volume AI Coding Tasks

GPT-5.5 Batch API and Flex mode both offer 50% off standard pricing — $2.50 per 1M input tokens and $15 per 1M output tokens versus the standard $5/$30 — giving high-volume AI coding teams a direct path to halving their monthly API spend without changing models or degrading output quality. What Is GPT-5.5 Batch API and Flex Mode? GPT-5.5 Batch API and Flex mode are two distinct pricing and execution tiers from OpenAI that both deliver 50% cost savings compared to standard API rates, but differ significantly in how and when results are returned. The Batch API is a fire-and-forget system: you submit up to 50,000 requests in a single JSONL file (up to 200MB), and OpenAI guarantees results within 24 hours. Flex mode, currently in beta as of April 2026, is interactive — requests are processed in real time but with variable latency ranging from a few seconds to several minutes, depending on platform load. GPT-5.5 launched on April 23, 2026, at standard pricing of $5 per 1M input tokens and $30 per 1M output tokens. Both Batch and Flex bring that cost down to $2.50/$15 — the same price as GPT-5.4 standard, but with GPT-5.5’s higher capability, including an 82.7% score on Terminal-Bench 2.0 and 58.6% on SWE-Bench Pro. For engineering teams running nightly code reviews, eval pipelines, or test generation jobs, the practical implication is straightforward: you get a better model at the same cost you were already paying. ...

April 25, 2026 · 16 min · baeseokjae
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