# openai-agents-python | OpenAI | Knowledge Base | Instagit

A lightweight, powerful framework for multi-agent workflows

GitHub Stars: 21.6k

Repository: https://github.com/openai/openai-agents-python

---

## Articles

### [How to Implement Multi-Agent Workflows with Agent-to-Agent Delegation in openai-agents-python](/openai/openai-agents-python/how-to-implement-multi-agent-workflows-agent-delegation)

Learn how to implement multi-agent workflows with agent-to-agent delegation in openai-agents-python. Master handoff and context transfer for seamless agent collaboration.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Migrate from Chat Completions to Responses API with set_default_openai_api in openai‑agents‑python](/openai/openai-agents-python/how-to-migrate-chat-completions-responses-api-set-default-openai-api)

Easily migrate from Chat Completions to the Responses API in openai-agents-python. Update your default API setting once and simplify your provider instances for a smoother workflow.

- Tags: migration-guide
- Published: 2026-04-17

### [How to Use CodeInterpreterTool for Sandboxed Code Execution in openai-agents-python](/openai/openai-agents-python/how-to-use-codeinterpreters-tool-sandboxed-code-execution)

Learn to use CodeInterpreterTool for secure, sandboxed code execution within openai-agents-python. Empower your agents with computational capabilities while protecting your host system.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Enable and Configure Tracing Sensitive Data Exclusion in **openai-agents-python**](/openai/openai-agents-python/how-to-enable-configure-tracing-sensitive-data-exclusion)

Learn to enable and configure tracing sensitive data exclusion in openai-agents-python. Secure your traces by setting environment variables or run config options.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Use WebSearchTool and FileSearchTool for Information Retrieval in openai-agents-python](/openai/openai-agents-python/how-to-use-websearchtool-filesearchtool-information-retrieval)

Learn to use WebSearchTool and FileSearchTool in openai-agents-python for effective information retrieval. Integrate these tools into your agent setup for powerful querying.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Manage Conversation History with Handoff History Mappers in openai-agents-python](/openai/openai-agents-python/how-to-manage-conversation-history-handoff-mappers)

Manage conversation history in openai-agents-python using handoff history mappers. Collapse transcripts into one message or customize context for the next agent.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Use ComputerTool and AsyncComputer for Browser Automation in openai-agents-python](/openai/openai-agents-python/how-to-use-computertool-async-computer-browser-automation)

Master browser automation with ComputerTool and AsyncComputer in openai-agents-python. Control real browsers for navigation, clicking, typing, and screenshots. Learn how today.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Handle and Customize Error Handling with RunErrorHandlers in openai-agents-python](/openai/openai-agents-python/how-to-handle-customize-error-handling-runerrorhandlers)

Master error handling in openai-agents-python with RunErrorHandlers. Intercept errors like MaxTurnsExceeded and customize outputs for a smoother user experience.

- Tags: how-to-guide
- Published: 2026-04-17

### [Tool Input and Output Guardrails vs Regular Guardrails in openai-agents-python](/openai/openai-agents-python/tool-input-output-guardrails-vs-regular-guardrails)

Discover the difference between tool input/output guardrails and regular guardrails in openai-agents-python. Gain granular control over agent behavior and content rejection without halting the process.

- Tags: deep-dive
- Published: 2026-04-17

### [How to Use RunHooks and AgentHooks to Intercept Agent Lifecycle Events in openai-agents-python](/openai/openai-agents-python/how-to-use-runhooks-agenthooks-intercept-lifecycle-events)

Intercept agent lifecycle events in openai-agents-python using RunHooks and AgentHooks. Easily customize agent behavior without altering core logic. Learn how now!

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Stream Agent Responses and Handle Streaming Events in openai-agents-python](/openai/openai-agents-python/how-to-stream-agent-responses-handle-streaming-events)

Learn to stream agent responses and handle streaming events with openai-agents-python. Use Runner.run_streamed() to access typed events like LLM deltas, tool calls, and agent handoffs.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Configure ModelRetrySettings and Custom Retry Policies in openai-agents-python](/openai/openai-agents-python/how-to-configure-model-retry-settings-custom-retry-policies)

Learn to configure ModelRetrySettings and custom retry policies in openai-agents-python. Control failed model calls with max retries, backoff, and custom policies.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Use SandboxAgent for Long-Running Tasks with Filesystem Access in openai-agents-python](/openai/openai-agents-python/how-to-use-sandboxagent-long-running-tasks-filesystem)

Safely run long-running tasks with filesystem access using SandboxAgent in openai-agents-python. Learn to configure Manifest, WorkspaceShellCapability, and SandboxRunConfig for powerful execution.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Set Up and Configure Tracing with Custom Processors in openai-agents-python](/openai/openai-agents-python/how-to-set-up-configure-tracing-custom-processors)

Learn to set up and configure tracing with custom processors in openai-agents-python. Subclass TracingProcessor implement hooks and register with TraceProvider for enhanced observability.

- Tags: how-to-guide
- Published: 2026-04-17

### [Implement Human-in-the-Loop Approval Workflows for Tool Execution in openai-agents-python](/openai/openai-agents-python/how-to-implement-human-in-the-loop-approval-workflows)

Learn to implement human-in-the-loop approval for tool execution in openai-agents-python. Approve or reject tool calls, control execution flow, and ensure safe AI interactions.

- Tags: how-to-guide
- Published: 2026-04-17

### [How Session Persistence Works with SQLite, Redis, and Custom Backends in openai-agents-python](/openai/openai-agents-python/how-session-persistence-works-sqlite-redis-custom)

Learn how openai-agents-python handles session persistence with SQLite, Redis, and custom backends. Explore the abstract async protocol and five core methods for seamless storage swapping.

- Tags: deep-dive
- Published: 2026-04-17

### [How to Integrate MCP Tools and Hosted MCP Tools into Agents in openai-agents-python](/openai/openai-agents-python/how-to-integrate-mcp-tools-hosted-mcp-tools)

Learn to integrate MCP tools and hosted MCP tools into your agents using the openai-agents-python SDK. Discover automatic discovery or direct invocation methods.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Create and Use FunctionTool with Custom Python Functions in openai-agents-python](/openai/openai-agents-python/how-to-create-use-functiontool-custom-python-functions)

Learn to create and use FunctionTool with custom Python functions in openai-agents-python. Expose any Python function to an LLM using the @function_tool decorator.

- Tags: how-to-guide
- Published: 2026-04-17

### [How Agent Handoffs Work in openai-agents-python: Input Filters and Configuration](/openai/openai-agents-python/how-agent-handoffs-work-configure-input-filters)

Learn how agent handoffs work in openai-agents-python. Discover how to configure input filters and preprocess context for seamless agent-to-agent communication.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Implement Input and Output Guardrails for Content Filtering and Validation in openai-agents-python](/openai/openai-agents-python/how-to-implement-input-output-guardrails-content-filtering)

Learn how to implement input and output guardrails in openai-agents-python for robust content filtering and validation. Secure your AI applications with custom rules.

- Tags: how-to-guide
- Published: 2026-04-17

### [How to Configure Model Provider Settings and Switch Between OpenAI, LiteLLM, and Custom Providers in openai-agents-python](/openai/openai-agents-python/how-to-configure-model-provider-settings-openai-lite-llm-custom)

Easily configure model provider settings and switch between OpenAI LiteLLM and custom providers in openai-agents-python using RunConfig. Learn to manage your LLM backends efficiently.

- Tags: how-to-guide
- Published: 2026-04-17

