Responses

OpenAI Responses API examples for structured output, tool use, multimodal input, deep research, reasoning, and storage controls.

ExampleDescription
OpenAI Agent Flex TierRun o4-mini on the flex service tier with the OpenAIResponses model.
OpenAI BasicRun a gpt-5.6-luna agent through the Responses API in sync, async, and streaming modes.
DBPersist Responses API sessions in Postgres and answer a history-dependent follow-up.
OpenAI Deep Research AgentBuild a cited web research agent with OpenAI Responses, with a current alternative to the retired Deep Research recipe.
OpenAI Image AgentDescribe an image from a URL and fetch related news via web search with OpenAIResponses.
OpenAI Image Agent BytesPass image bytes to a Responses API agent that pairs vision with web search.
OpenAI Image Agent With MemoryReference an earlier image in follow-up questions after adding a database for session history.
Image Generation AgentGenerate and save an image with OpenAITools and GPT Image 2.
KnowledgeAnswer questions from a PDF stored in PgVector knowledge with OpenAIResponses.
MemoryStore user memories and session summaries in Postgres while chatting through the Responses API.
OpenAI PDF Input LocalQuery a PDF with an explicit File Search index, bounded indexing checks, and cleanup of owned resources.
OpenAI PDF Input URLQuery a PDF with an explicit File Search index, bounded indexing checks, and cleanup of owned resources.
OpenAI Reasoning O3 MiniStream retrieved stock quotes from o3-mini with YFinance tools via the Responses API.
OpenAI Structured OutputGenerate a MovieScript Pydantic model via JSON mode, strict, and guided structured output.
OpenAI Structured Output With ToolsCombine web search tools with a Pydantic output schema on gpt-5-mini.
Tool UseAnswer a news question with WebSearchTools through the Responses API.
OpenAI Tool Use GPT 5Fetch stock quotes through the Responses API with cached YFinance tool results.
OpenAI Tool Use O3Fetch stock quotes through the Responses API with cached YFinance tool results.
OpenAI WebSearch Builtin ToolCombine the built-in web_search_preview tool with FileTools to search and save results to disk.
ZDR Reasoning AgentDisable Responses application-state storage with store=False while retaining multi-turn context in InMemoryDb.
Background ModeRun GPT-5.4 in background mode with automatic polling and a 600-second default maximum wait.
OpenAI File Input DirectAttach files by URL, local path, or raw bytes to a Responses API agent.
Responses Image Agent FileAttach a local image by filepath to a Responses API agent, overriding the MIME type if needed.
OpenAI Reasoning EffortSet xhigh reasoning effort and request an automatic reasoning summary from OpenAI Responses.
Responses Verbosity ControlSet desired response detail through OpenAI Responses while comparing retrieved stock quotes.