openapi: 3.2.0 info: title: OpenAI Webhook Endpoints API description: The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details. version: 2.3.0 termsOfService: https://openai.com/policies/terms-of-use contact: name: OpenAI Support url: https://help.openai.com/ license: name: MIT identifier: MIT servers: - url: https://api.openai.com/v1 security: - ApiKeyAuth: [] tags: - name: Webhook Endpoints paths: /webhook_endpoints: get: summary: List Webhook Endpoints description: Returns webhook endpoints for the authenticated project in newest-first order. operationId: ListWebhookEndpoints parameters: - name: limit in: query description: Maximum number of webhook endpoints to return. Defaults to 20. required: false schema: type: integer minimum: 1 maximum: 100 - name: after in: query description: ID of the last webhook endpoint from the previous page. required: false schema: anyOf: - example: whe_123 type: string - type: 'null' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointListResource' x-oaiMeta: beta: true tags: - Webhook Endpoints post: summary: Create Webhook Endpoint description: Creates a webhook endpoint for the authenticated project. operationId: CreateWebhookEndpoint parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/PublicCreateEndpointBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointWithSecretResource' x-oaiMeta: beta: true tags: - Webhook Endpoints /webhook_endpoints/{webhook_endpoint_id}: get: summary: Retrieve Webhook Endpoint description: Retrieves a webhook endpoint for the authenticated project. operationId: RetrieveWebhookEndpoint parameters: - name: webhook_endpoint_id in: path description: The ID of the webhook endpoint to retrieve. required: true schema: example: whe_123 type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointBody' x-oaiMeta: beta: true tags: - Webhook Endpoints post: summary: Update Webhook Endpoint description: Updates a webhook endpoint for the authenticated project. operationId: UpdateWebhookEndpoint parameters: - name: webhook_endpoint_id in: path description: The ID of the webhook endpoint to update. required: true schema: example: whe_123 type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/PublicUpdateEndpointBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointBody' x-oaiMeta: beta: true tags: - Webhook Endpoints delete: summary: Delete Webhook Endpoint description: Deletes a webhook endpoint for the authenticated project. operationId: DeleteWebhookEndpoint parameters: - name: webhook_endpoint_id in: path description: The ID of the webhook endpoint to delete. required: true schema: example: whe_123 type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/DeletedWebhookEndpointResource' x-oaiMeta: beta: true tags: - Webhook Endpoints /webhook_endpoints/{webhook_endpoint_id}/rotate_secret: post: summary: Rotate Webhook Endpoint Signing Secret description: Rotates the signing secret for a webhook endpoint in the authenticated project. operationId: RotateWebhookEndpointSigningSecret parameters: - name: webhook_endpoint_id in: path description: The ID of the webhook endpoint whose signing secret will be rotated. required: true schema: example: whe_123 type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/PublicRotateSecretBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointWithSecretResource' x-oaiMeta: beta: true tags: - Webhook Endpoints /webhook_endpoints/{webhook_endpoint_id}/test: post: summary: Test Webhook Endpoint description: Sends a sample event to a webhook endpoint for the authenticated project. operationId: TestWebhookEndpoint parameters: - name: webhook_endpoint_id in: path description: The ID of the webhook endpoint to test. required: true schema: example: whe_123 type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/PublicTestEndpointBody' responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/WebhookEndpointTestResultResource' x-oaiMeta: beta: true tags: - Webhook Endpoints components: schemas: PublicTestEndpointBody: properties: event_type: $ref: '#/components/schemas/ProjectEventTypeEnum' description: The event type to send as a sample delivery. type: object required: - event_type PublicRotateSecretBody: properties: keep_old_secret_active_for_24_hours: type: boolean description: Whether to keep the previous signing secret valid for 24 hours after rotation. Defaults to false, which invalidates the previous secret immediately. type: object required: [] ProjectEventTypeEnum: type: string enum: - batch.completed - batch.failed - batch.expired - batch.cancelled - response.completed - response.failed - response.cancelled - response.incomplete - eval.run.succeeded - eval.run.failed - eval.run.canceled - fine_tuning.job.succeeded - fine_tuning.job.failed - fine_tuning.job.cancelled - realtime.call.incoming - video.completed - video.failed - safety.alert.created WebhookEndpointListResource: properties: object: type: string enum: - list description: The object type, which is always list. default: list x-stainless-const: true data: items: $ref: '#/components/schemas/WebhookEndpointBody' type: array description: The webhook endpoints in this page. first_id: anyOf: - type: string description: The ID of the first endpoint in this page. - type: 'null' last_id: anyOf: - type: string description: The ID of the last endpoint in this page. - type: 'null' has_more: type: boolean description: Whether more webhook endpoints are available. type: object required: - object - data - first_id - last_id - has_more WebhookEndpointTestResultResource: properties: object: type: string enum: - webhook_endpoint.test description: The object type, which is always webhook_endpoint.test. default: webhook_endpoint.test x-stainless-const: true webhook_endpoint_id: type: string description: The ID of the webhook endpoint that received the test. event_type: type: string description: The event type sent in the test. status_code: type: integer description: The HTTP status code returned by the endpoint. success: type: boolean enum: - true description: Whether the test request completed. Always true for returned results; use status_code to determine the endpoint response. default: true x-stainless-const: true type: object required: - object - webhook_endpoint_id - event_type - status_code - success WebhookEndpointWithSecretResource: properties: id: type: string description: The unique ID of the webhook endpoint. object: type: string enum: - webhook_endpoint description: The object type, which is always webhook_endpoint. default: webhook_endpoint x-stainless-const: true created_at: type: integer format: unixtime description: The Unix timestamp when the endpoint was created. updated_at: type: integer format: unixtime description: The Unix timestamp of the last endpoint configuration or signing-secret change. Initialized at creation; tests and unchanged updates do not advance it. name: type: string description: The human-readable name of the endpoint. url: type: string description: The HTTPS URL that receives webhook deliveries. event_types: items: type: string type: array description: The event types that trigger deliveries to this endpoint. signing_secret_hint: anyOf: - type: string description: A masked hint for the endpoint's signing secret. - type: 'null' signing_secret: type: string description: The endpoint's signing secret. This is returned only when the endpoint is created or the secret is rotated. type: object required: - id - object - created_at - name - url - event_types - signing_secret_hint - signing_secret PublicUpdateEndpointBody: properties: name: type: string maxLength: 256 minLength: 1 description: A new human-readable name for the webhook endpoint. url: type: string maxLength: 2048 pattern: ^https:// description: A new HTTPS URL that receives webhook deliveries. event_types: items: $ref: '#/components/schemas/ProjectEventTypeEnum' type: array minItems: 1 description: The complete set of event types that should trigger deliveries. type: object required: [] PublicCreateEndpointBody: properties: name: type: string maxLength: 256 minLength: 1 description: A human-readable name for the webhook endpoint. url: type: string maxLength: 2048 pattern: ^https:// description: The HTTPS URL that receives webhook deliveries. event_types: items: $ref: '#/components/schemas/ProjectEventTypeEnum' type: array minItems: 1 description: The event types that trigger deliveries to this endpoint. type: object required: - name - url - event_types DeletedWebhookEndpointResource: properties: id: type: string description: The ID of the deleted webhook endpoint. object: type: string enum: - webhook_endpoint.deleted description: The object type, which is always webhook_endpoint.deleted. default: webhook_endpoint.deleted x-stainless-const: true deleted: type: boolean description: Whether the endpoint was deleted. type: object required: - id - object - deleted WebhookEndpointBody: properties: id: type: string description: The unique ID of the webhook endpoint. object: type: string enum: - webhook_endpoint description: The object type, which is always webhook_endpoint. default: webhook_endpoint x-stainless-const: true created_at: type: integer format: unixtime description: The Unix timestamp when the endpoint was created. updated_at: type: integer format: unixtime description: The Unix timestamp of the last endpoint configuration or signing-secret change. Initialized at creation; tests and unchanged updates do not advance it. name: type: string description: The human-readable name of the endpoint. url: type: string description: The HTTPS URL that receives webhook deliveries. event_types: items: type: string type: array description: The event types that trigger deliveries to this endpoint. signing_secret_hint: anyOf: - type: string description: A masked hint for the endpoint's signing secret. - type: 'null' type: object required: - id - object - created_at - name - url - event_types - signing_secret_hint securitySchemes: ApiKeyAuth: type: http scheme: bearer AdminApiKeyAuth: type: http scheme: bearer x-oaiMeta: navigationGroups: - id: responses title: Responses API - id: webhooks title: Webhooks - id: endpoints title: Platform APIs - id: vector_stores title: Vector stores - id: chatkit title: ChatKit beta: true - id: containers title: Containers - id: live title: Live (alpha) - id: realtime title: Realtime - id: chat title: Chat Completions - id: assistants title: Assistants deprecated: true - id: administration title: Administration - id: legacy title: Legacy groups: - id: responses-streaming title: Streaming events description: 'When you [create a Response](https://developers.openai.com/api/reference/resources/responses/methods/create) with `stream` set to `true`, the server will emit server-sent events to the client as the Response is generated. This section contains the events that are emitted by the server. When processing a `compaction_trigger`, `response.compaction.compacting` reports newly sampled summary output at most once every 30 seconds. It carries no summary content and does not modify the compaction output item. The existing `response.output_item.added` and `response.output_item.done` events mark that item''s lifecycle; `response.output_item.done` carries its final encrypted content. A short compaction may finish without emitting a progress event. [Learn more about streaming responses](https://developers.openai.com/api/docs/guides/streaming-responses). ' navigationGroup: responses sections: - type: object key: ResponseCreatedEvent path: - type: object key: ResponseInProgressEvent path: - type: object key: ResponseCompletedEvent path: - type: object key: ResponseFailedEvent path: - type: object key: ResponseIncompleteEvent path: - type: object key: ResponseOutputItemAddedEvent path: - type: object key: ResponseOutputItemDoneEvent path: - type: object key: ResponseCompactionCompactingEvent path: - type: object key: ResponseContentPartAddedEvent path: - type: object key: ResponseContentPartDoneEvent path: - type: object key: ResponseTextDeltaEvent path: response/output_text/delta - type: object key: ResponseTextDoneEvent path: response/output_text/done - type: object key: ResponseRefusalDeltaEvent path: - type: object key: ResponseRefusalDoneEvent path: - type: object key: ResponseFunctionCallArgumentsDeltaEvent path: - type: object key: ResponseFunctionCallArgumentsDoneEvent path: - type: object key: ResponseFileSearchCallInProgressEvent path: - type: object key: ResponseFileSearchCallSearchingEvent path: - type: object key: ResponseFileSearchCallCompletedEvent path: - type: object key: ResponseWebSearchCallInProgressEvent path: - type: object key: ResponseWebSearchCallSearchingEvent path: - type: object key: ResponseWebSearchCallCompletedEvent path: - type: object key: ResponseReasoningSummaryPartAddedEvent path: - type: object key: ResponseReasoningSummaryPartDoneEvent path: - type: object key: ResponseReasoningSummaryTextDeltaEvent path: - type: object key: ResponseReasoningSummaryTextDoneEvent path: - type: object key: ResponseReasoningTextDeltaEvent path: - type: object key: ResponseReasoningTextDoneEvent path: - type: object key: ResponseImageGenCallCompletedEvent path: - type: object key: ResponseImageGenCallGeneratingEvent path: - type: object key: ResponseImageGenCallInProgressEvent path: - type: object key: ResponseImageGenCallPartialImageEvent path: - type: object key: ResponseMCPCallArgumentsDeltaEvent path: - type: object key: ResponseMCPCallArgumentsDoneEvent path: - type: object key: ResponseMCPCallCompletedEvent path: - type: object key: ResponseMCPCallFailedEvent path: - type: object key: ResponseMCPCallInProgressEvent path: - type: object key: ResponseMCPListToolsCompletedEvent path: - type: object key: ResponseMCPListToolsFailedEvent path: - type: object key: ResponseMCPListToolsInProgressEvent path: - type: object key: ResponseCodeInterpreterCallInProgressEvent path: - type: object key: ResponseCodeInterpreterCallInterpretingEvent path: - type: object key: ResponseCodeInterpreterCallCompletedEvent path: - type: object key: ResponseCodeInterpreterCallCodeDeltaEvent path: - type: object key: ResponseCodeInterpreterCallCodeDoneEvent path: - type: object key: ResponseOutputTextAnnotationAddedEvent path: - type: object key: ResponseQueuedEvent path: - type: object key: ResponseCustomToolCallInputDeltaEvent path: - type: object key: ResponseCustomToolCallInputDoneEvent path: - type: object key: ResponseErrorEvent path: - id: responses-websocket-client-events title: Client events description: 'Events sent by the client over a Responses API WebSocket connection. ' navigationGroup: responses sections: - type: object key: ResponsesClientEventResponseCreate path: - type: object key: ResponseSteerEvent path: - id: responses-websocket-server-events title: Server events (WebSocket only) description: 'Events emitted only over a Responses API WebSocket connection. ' navigationGroup: responses sections: - type: object key: ResponseSteerAcceptedEvent path: - type: object key: ResponseSteerPendingEvent path: - type: object key: ResponseSteerFailedEvent path: - id: responses-websocket-shared-events title: Server events description: 'These events use the same payloads over WebSocket and [HTTP streaming](https://developers.openai.com/api/reference/resources/responses/streaming-events). Compaction progress follows the same cadence and output-item lifecycle described in HTTP streaming. ' navigationGroup: responses sections: - type: object key: ResponseCreatedEvent path: - type: object key: ResponseInProgressEvent path: - type: object key: ResponseCompletedEvent path: - type: object key: ResponseFailedEvent path: - type: object key: ResponseIncompleteEvent path: - type: object key: ResponseOutputItemAddedEvent path: - type: object key: ResponseOutputItemDoneEvent path: - type: object key: ResponseCompactionCompactingEvent path: - type: object key: ResponseContentPartAddedEvent path: - type: object key: ResponseContentPartDoneEvent path: - type: object key: ResponseTextDeltaEvent path: response/output_text/delta - type: object key: ResponseTextDoneEvent path: response/output_text/done - type: object key: ResponseRefusalDeltaEvent path: - type: object key: ResponseRefusalDoneEvent path: - type: object key: ResponseFunctionCallArgumentsDeltaEvent path: - type: object key: ResponseFunctionCallArgumentsDoneEvent path: - type: object key: ResponseFileSearchCallInProgressEvent path: - type: object key: ResponseFileSearchCallSearchingEvent path: - type: object key: ResponseFileSearchCallCompletedEvent path: - type: object key: ResponseWebSearchCallInProgressEvent path: - type: object key: ResponseWebSearchCallSearchingEvent path: - type: object key: ResponseWebSearchCallCompletedEvent path: - type: object key: ResponseReasoningSummaryPartAddedEvent path: - type: object key: ResponseReasoningSummaryPartDoneEvent path: - type: object key: ResponseReasoningSummaryTextDeltaEvent path: - type: object key: ResponseReasoningSummaryTextDoneEvent path: - type: object key: ResponseReasoningTextDeltaEvent path: - type: object key: ResponseReasoningTextDoneEvent path: - type: object key: ResponseImageGenCallCompletedEvent path: - type: object key: ResponseImageGenCallGeneratingEvent path: - type: object key: ResponseImageGenCallInProgressEvent path: - type: object key: ResponseImageGenCallPartialImageEvent path: - type: object key: ResponseMCPCallArgumentsDeltaEvent path: - type: object key: ResponseMCPCallArgumentsDoneEvent path: - type: object key: ResponseMCPCallCompletedEvent path: - type: object key: ResponseMCPCallFailedEvent path: - type: object key: ResponseMCPCallInProgressEvent path: - type: object key: ResponseMCPListToolsCompletedEvent path: - type: object key: ResponseMCPListToolsFailedEvent path: - type: object key: ResponseMCPListToolsInProgressEvent path: - type: object key: ResponseCodeInterpreterCallInProgressEvent path: - type: object key: ResponseCodeInterpreterCallInterpretingEvent path: - type: object key: ResponseCodeInterpreterCallCompletedEvent path: - type: object key: ResponseCodeInterpreterCallCodeDeltaEvent path: - type: object key: ResponseCodeInterpreterCallCodeDoneEvent path: - type: object key: ResponseOutputTextAnnotationAddedEvent path: - type: object key: ResponseQueuedEvent path: - type: object key: ResponseCustomToolCallInputDeltaEvent path: - type: object key: ResponseCustomToolCallInputDoneEvent path: - type: object key: ResponseErrorEvent path: - id: safety-cases title: Safety Cases description: 'Retrieve details about a safety warning or deactivation using the case ID from a `safety.warning_issued` or `safety.deactivation_issued` webhook event. Cases belong to an organization and require an API key with `api.safety.read`. ' navigationGroup: endpoints sections: - type: endpoint key: Getsafetycase path: retrieve - type: object key: SafetyCaseResource path: object - id: safety-alerts title: Safety Alerts description: 'Retrieve approved safety alerts with an API key. Project keys require `api.safety.alerts.read` and can read alerts from their project. ' navigationGroup: endpoints sections: - type: endpoint key: Getprojectsafetyalert path: retrieve - type: object key: SafetyAlertResource path: object - id: webhook-events title: Webhook Events description: 'Webhooks are HTTP requests sent by OpenAI to a URL you specify when certain events happen during the course of API usage. [Learn more about webhooks](https://developers.openai.com/api/docs/guides/webhooks). ' navigationGroup: webhooks sections: - type: object key: WebhookResponseCompleted path: - type: object key: WebhookResponseCancelled path: - type: object key: WebhookResponseFailed path: - type: object key: WebhookResponseIncomplete path: - type: object key: WebhookBatchCompleted path: - type: object key: WebhookBatchCancelled path: - type: object key: WebhookBatchExpired path: - type: object key: WebhookBatchFailed path: - type: object key: WebhookFineTuningJobSucceeded path: - type: object key: WebhookFineTuningJobFailed path: - type: object key: WebhookFineTuningJobCancelled path: - type: object key: WebhookEvalRunSucceeded path: - type: object key: WebhookEvalRunFailed path: - type: object key: WebhookEvalRunCanceled path: - type: object key: WebhookRealtimeCallIncoming path: - type: object key: WebhookLiveCallIncoming path: - type: object key: WebhookLiveTransportIncoming path: - type: object key: WebhookSafetyWarningIssued path: - type: object key: WebhookSafetyDeactivationIssued path: - type: object key: WebhookSafetyAlertCreated path: - type: object key: WebhookSafetyOrgAlertCreated path: - id: images-streaming title: Image Streaming description: 'Stream image generation and editing in real time with server-sent events. [Learn more about image streaming](https://developers.openai.com/api/docs/guides/image-generation). ' navigationGroup: endpoints sections: - type: object key: ImageGenPartialImageEvent path: - type: object key: ImageGenCompletedEvent path: - type: object key: ImageEditPartialImageEvent path: - type: object key: ImageEditCompletedEvent path: - id: realtime-client-events title: Client events description: 'These are events that the OpenAI Realtime WebSocket server will accept from the client. ' navigationGroup: realtime sections: - type: object key: RealtimeClientEventSessionUpdate path: - type: object key: RealtimeClientEventInputAudioBufferAppend path: - type: object key: RealtimeClientEventInputAudioBufferCommit path: - type: object key: RealtimeClientEventInputAudioBufferClear path: - type: object key: RealtimeClientEventConversationItemCreate path: - type: object key: RealtimeClientEventConversationItemRetrieve path: - type: object key: RealtimeClientEventConversationItemTruncate path: - type: object key: RealtimeClientEventConversationItemDelete path: - type: object key: RealtimeClientEventResponseCreate path: - type: object key: RealtimeClientEventResponseCancel path: - type: object key: RealtimeClientEventOutputAudioBufferClear path: - id: realtime-server-events title: Server events description: 'These are events emitted from the OpenAI Realtime WebSocket server to the client. ' navigationGroup: realtime sections: - type: object key: RealtimeServerEventError path: - type: object key: RealtimeServerEventSessionCreated path: - type: object key: RealtimeServerEventSessionUpdated path: - type: object key: RealtimeServerEventConversationItemAdded path: - type: object key: RealtimeServerEventConversationItemDone path: - type: object key: RealtimeServerEventConversationItemRetrieved path: - type: object key: RealtimeServerEventConversationItemInputAudioTranscriptionCompleted path: - type: object key: RealtimeServerEventConversationItemInputAudioTranscriptionDelta path: - type: object key: RealtimeServerEventConversationItemInputAudioTranscriptionSegment path: - type: object key: RealtimeServerEventConversationItemInputAudioTranscriptionFailed path: - type: object key: RealtimeServerEventConversationItemTruncated path: - type: object key: RealtimeServerEventConversationItemDeleted path: - type: object key: RealtimeServerEventInputAudioBufferCommitted path: - type: object key: RealtimeServerEventInputAudioBufferDtmfEventReceived path: - type: object key: RealtimeServerEventInputAudioBufferCleared path: - type: object key: RealtimeServerEventInputAudioBufferSpeechStarted path: - type: object key: RealtimeServerEventInputAudioBufferSpeechStopped path: - type: object key: RealtimeServerEventInputAudioBufferTimeoutTriggered path: - type: object key: RealtimeServerEventOutputAudioBufferStarted path: - type: object key: RealtimeServerEventOutputAudioBufferStopped path: - type: object key: RealtimeServerEventOutputAudioBufferCleared path: - type: object key: RealtimeServerEventResponseCreated path: - type: object key: RealtimeServerEventResponseDone path: - type: object key: RealtimeServerEventResponseOutputItemAdded path: - type: object key: RealtimeServerEventResponseOutputItemDone path: - type: object key: RealtimeServerEventResponseContentPartAdded path: - type: object key: RealtimeServerEventResponseContentPartDone path: - type: object key: RealtimeServerEventResponseTextDelta path: - type: object key: RealtimeServerEventResponseTextDone path: - type: object key: RealtimeServerEventResponseAudioTranscriptDelta path: - type: object key: RealtimeServerEventResponseAudioTranscriptDone path: - type: object key: RealtimeServerEventResponseAudioDelta path: - type: object key: RealtimeServerEventResponseAudioDone path: - type: object key: RealtimeServerEventResponseFunctionCallArgumentsDelta path: - type: object key: RealtimeServerEventResponseFunctionCallArgumentsDone path: - type: object key: RealtimeServerEventResponseMCPCallArgumentsDelta path: - type: object key: RealtimeServerEventResponseMCPCallArgumentsDone path: - type: object key: RealtimeServerEventResponseMCPCallInProgress path: - type: object key: RealtimeServerEventResponseMCPCallCompleted path: - type: object key: RealtimeServerEventResponseMCPCallFailed path: - type: object key: RealtimeServerEventMCPListToolsInProgress path: - type: object key: RealtimeServerEventMCPListToolsCompleted path: - type: object key: RealtimeServerEventMCPListToolsFailed path: - type: object key: RealtimeServerEventRateLimitsUpdated path: - id: realtime-translation-client-events title: Translation client events description: 'These are events that the OpenAI Realtime Translation WebSocket server will accept from the client. ' navigationGroup: realtime sections: - type: object key: RealtimeTranslationClientEventSessionUpdate path: - type: object key: RealtimeTranslationClientEventInputAudioBufferAppend path: - type: object key: RealtimeTranslationClientEventSessionClose path: - id: realtime-translation-server-events title: Translation server events description: 'These are events emitted from the OpenAI Realtime Translation WebSocket server to the client. ' navigationGroup: realtime sections: - type: object key: RealtimeServerEventError path: - type: object key: RealtimeTranslationServerEventSessionCreated path: - type: object key: RealtimeTranslationServerEventSessionUpdated path: - type: object key: RealtimeTranslationServerEventSessionClosed path: - type: object key: RealtimeTranslationServerEventSessionInputTranscriptDelta path: - type: object key: RealtimeTranslationServerEventSessionOutputTranscriptDelta path: - type: object key: RealtimeTranslationServerEventSessionOutputAudioDelta path: - id: chat-streaming title: Streaming description: 'Stream Chat Completions in real time. Receive chunks of completions returned from the model using server-sent events. [Learn more](https://developers.openai.com/api/docs/guides/streaming-responses). ' navigationGroup: chat sections: - type: object key: CreateChatCompletionStreamResponse path: streaming - id: assistants-streaming title: Streaming beta: true description: 'Stream the result of executing a Run or resuming a Run after submitting tool outputs. You can stream events from the [Create Thread and Run](https://developers.openai.com/api/docs/assistants/migration), [Create Run](https://developers.openai.com/api/docs/assistants/migration), and [Submit Tool Outputs](https://developers.openai.com/api/docs/assistants/migration) endpoints by passing `"stream": true`. The response will be a [Server-Sent events](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events) stream. Our Node and Python SDKs provide helpful utilities to make streaming easy. Reference the [Assistants API quickstart](https://developers.openai.com/api/docs/assistants/migration) to learn more. ' navigationGroup: assistants sections: - type: object key: AssistantStreamEvent path: events - id: realtime-beta-client-events title: Realtime Beta client events description: 'These are events that the OpenAI Realtime WebSocket server will accept from the client. ' navigationGroup: legacy sections: - type: object key: RealtimeBetaClientEventSessionUpdate path: - type: object key: RealtimeBetaClientEventInputAudioBufferAppend path: - type: object key: RealtimeBetaClientEventInputAudioBufferCommit path: - type: object key: RealtimeBetaClientEventInputAudioBufferClear path: - type: object key: RealtimeBetaClientEventConversationItemCreate path: - type: object key: RealtimeBetaClientEventConversationItemRetrieve path: - type: object key: RealtimeBetaClientEventConversationItemTruncate path: - type: object key: RealtimeBetaClientEventConversationItemDelete path: - type: object key: RealtimeBetaClientEventResponseCreate path: - type: object key: RealtimeBetaClientEventResponseCancel path: - type: object key: RealtimeBetaClientEventTranscriptionSessionUpdate path: - type: object key: RealtimeBetaClientEventOutputAudioBufferClear path: - id: realtime-beta-server-events title: Realtime Beta server events description: 'These are events emitted from the OpenAI Realtime WebSocket server to the client. ' navigationGroup: legacy sections: - type: object key: RealtimeBetaServerEventError path: - type: object key: RealtimeBetaServerEventSessionCreated path: - type: object key: RealtimeBetaServerEventSessionUpdated path: - type: object key: RealtimeBetaServerEventTranscriptionSessionCreated path: - type: object key: RealtimeBetaServerEventTranscriptionSessionUpdated path: - type: object key: RealtimeBetaServerEventConversationItemCreated path: - type: object key: RealtimeBetaServerEventConversationItemRetrieved path: - type: object key: RealtimeBetaServerEventConversationItemInputAudioTranscriptionCompleted path: - type: object key: RealtimeBetaServerEventConversationItemInputAudioTranscriptionDelta path: - type: object key: RealtimeBetaServerEventConversationItemInputAudioTranscriptionSegment path: - type: object key: RealtimeBetaServerEventConversationItemInputAudioTranscriptionFailed path: - type: object key: RealtimeBetaServerEventConversationItemTruncated path: - type: object key: RealtimeBetaServerEventConversationItemDeleted path: - type: object key: RealtimeBetaServerEventInputAudioBufferCommitted path: - type: object key: RealtimeBetaServerEventInputAudioBufferCleared path: - type: object key: RealtimeBetaServerEventInputAudioBufferSpeechStarted path: - type: object key: RealtimeBetaServerEventInputAudioBufferSpeechStopped path: - type: object key: RealtimeServerEventInputAudioBufferTimeoutTriggered path: - type: object key: RealtimeBetaServerEventResponseCreated path: - type: object key: RealtimeBetaServerEventResponseDone path: - type: object key: RealtimeBetaServerEventResponseOutputItemAdded path: - type: object key: RealtimeBetaServerEventResponseOutputItemDone path: - type: object key: RealtimeBetaServerEventResponseContentPartAdded path: - type: object key: RealtimeBetaServerEventResponseContentPartDone path: - type: object key: RealtimeBetaServerEventResponseTextDelta path: - type: object key: RealtimeBetaServerEventResponseTextDone path: - type: object key: RealtimeBetaServerEventResponseAudioTranscriptDelta path: - type: object key: RealtimeBetaServerEventResponseAudioTranscriptDone path: - type: object key: RealtimeBetaServerEventResponseAudioDelta path: - type: object key: RealtimeBetaServerEventResponseAudioDone path: - type: object key: RealtimeBetaServerEventResponseFunctionCallArgumentsDelta path: - type: object key: RealtimeBetaServerEventResponseFunctionCallArgumentsDone path: - type: object key: RealtimeBetaServerEventResponseMCPCallArgumentsDelta path: - type: object key: RealtimeBetaServerEventResponseMCPCallArgumentsDone path: - type: object key: RealtimeBetaServerEventResponseMCPCallInProgress path: - type: object key: RealtimeBetaServerEventResponseMCPCallCompleted path: - type: object key: RealtimeBetaServerEventResponseMCPCallFailed path: - type: object key: RealtimeBetaServerEventMCPListToolsInProgress path: - type: object key: RealtimeBetaServerEventMCPListToolsCompleted path: - type: object key: RealtimeBetaServerEventMCPListToolsFailed path: - type: object key: RealtimeBetaServerEventRateLimitsUpdated path: - id: live-client-events title: Client events description: Initialize a primary WebSocket with session.start and wait for session.started before sending other events. WebRTC creation starts the session for you. Start with the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) to design frontend instructions and delegation policy; see [backend prompting](https://developers.openai.com/api/docs/guides/live-delegation#start-with-your-existing-backend-prompt) for tools and business rules. navigationGroup: live sections: - type: object key: LiveSessionStartEvent path: - type: object key: LiveForkSessionStartEvent path: - type: object key: LiveSessionUpdateParam path: - type: object key: LiveInputAudioAppendEvent path: - type: object key: LiveInputAudioMuteParam path: - type: object key: LiveInputAudioUnmuteParam path: - type: object key: LiveInstructionsAppendParam path: - type: object key: LiveThinkingAppendParam path: - type: object key: LiveCommentaryAppendParam path: - type: object key: LiveResponseItemCreateParam path: - type: object key: LiveResponseCreateParam path: - type: object key: LiveSessionCloseParam path: - id: live-server-events title: Server events description: Live server events. Responses delegation lifecycle events arrive inside response.event, not as top-level response events. Start with the [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting) to design frontend instructions and delegation policy; see [backend prompting](https://developers.openai.com/api/docs/guides/live-delegation#start-with-your-existing-backend-prompt) for tools and business rules. navigationGroup: live sections: - type: object key: LiveSessionStarted path: - type: object key: LiveSessionUpdated path: - type: object key: LiveInputAudioMuted path: - type: object key: LiveInputAudioUnmuted path: - type: object key: LiveInstructionsAppended path: - type: object key: LiveThinkingAppended path: - type: object key: LiveCommentaryAppended path: - type: object key: LiveOutputAudioDelta path: - type: object key: LiveInputTranscriptDelta path: - type: object key: LiveOutputTranscriptDelta path: - type: object key: LiveDelegationCreated path: - type: object key: LiveResponseEvent path: - type: object key: LiveSessionUsageUpdated path: - type: object key: LiveSessionClosed path: - type: object key: LiveErrorEvent path: - type: object key: LiveInfoEvent path: