agents/apiTHE ENCYCLOPEDIA
Integration guides

Streaming, webhooks & event handling

Build progress feedback and reconnect safely without confusing transport state with task success.

Session starts
Progress events
Required action or output
Turn outcome
Persist result

Streaming for live feedback

A stream delivers progress while the agent works. Forward appropriate events through your application server to the user interface. Treat text deltas, tool activity, and terminal outcomes as different UI states. Keep the OpenAI application key on the server.

Webhooks for asynchronous work

Webhooks notify your backend about session state changes without holding a client connection open. A handler can retrieve results or dispatch work to a tool handler. Verify signatures according to the official webhook guide and deduplicate deliveries before side effects.

Disconnection is not cancellation

A browser refresh or interrupted stream does not prove that the turn failed. Save session identifiers, retrieve durable history, and reconnect. Show a reconnecting state rather than marking incomplete transport as completed work.

Use actual outcome events

Check turn.completed, turn.failed, turn.cancelled, and session failure events. An idle session is not itself a successful result. Tool failures can also appear inside a completed turn, so inspect the reported outcome and required artifacts.

Read the official reference

Check the source for current API fields, account requirements, and service limits.

OpenAI: architecture

23 matching topics

What is the OpenAI Agents API?FoundationsAgents API vs Agents SDK vs Responses APIComparisonsAgents API quickstartGetting startedSessions, turns & durable stateCore conceptsHosted vs self-hosted sandboxesInfrastructureConnect MCP servers to Agents APITools & integrationsFunction calling & application toolsTools & integrationsMulti-agent orchestrationCore conceptsStreaming, webhooks & event handlingIntegration guidesFiles, outputs & published artifactsCore conceptsVaults & MCP authenticationTools & integrationsAgent security & credential boundariesProductionTracing, usage & debuggingProductionAgents API pricing & cost planningProductionOpenAI Agents API with PythonGetting startedAgents API with TypeScript & Next.jsIntegration guidesWhat is the OpenAI Agents SDK?FoundationsResponses API in the agent stackFoundationsAgent Skills & SKILL.mdTools & integrationsProgrammatic Tool CallingTools & integrationsRAG, file search & vector storesTools & integrationsWeb search & source citationsTools & integrationsChatKit & Agent BuilderIntegration guides
K to open Esc to close