Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.35.1"
".": "2.36.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 233
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-84d31411083374ec6cdb4a722f8b8b83c1230741157306b1ca7ba1a3cf246672.yml
openapi_spec_hash: 051fce676f959b8207e2317225ec4bdc
config_hash: a2916f18a94ff65c8116ca2fe3256f10
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-371f497afe4d6070f6e252e5febbe8f453c7058a8dff0c26a01b4d88442a4ac2.yml
openapi_spec_hash: d39f46e8fda45f77096448105efd175a
config_hash: b64135fff1fe9cf4069b9ecf59ae8b07
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2.36.0 (2026-05-07)

Full Changelog: [v2.35.1...v2.36.0](https://github.com/openai/openai-python/compare/v2.35.1...v2.36.0)

### Features

* **api:** manual updates ([13c639c](https://github.com/openai/openai-python/commit/13c639cc7d57e4fbd4406563511e15eeb88a54b2))
* **api:** realtime 2 ([8fe0ab8](https://github.com/openai/openai-python/commit/8fe0ab87e67eeb3cc27426b50093845229520f0e))

## 2.35.1 (2026-05-06)

Full Changelog: [v2.35.0...v2.35.1](https://github.com/openai/openai-python/compare/v2.35.0...v2.35.1)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "2.35.1"
version = "2.36.0"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/openai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openai"
__version__ = "2.35.1" # x-release-please-version
__version__ = "2.36.0" # x-release-please-version
19 changes: 18 additions & 1 deletion src/openai/resources/realtime/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ from openai.types.realtime import (
RealtimeMcpToolCall,
RealtimeMcpToolExecutionError,
RealtimeMcphttpError,
RealtimeReasoning,
RealtimeReasoningEffort,
RealtimeResponse,
RealtimeResponseCreateAudioOutput,
RealtimeResponseCreateMcpTool,
Expand All @@ -77,6 +79,22 @@ from openai.types.realtime import (
RealtimeTranscriptionSessionAudioInput,
RealtimeTranscriptionSessionAudioInputTurnDetection,
RealtimeTranscriptionSessionCreateRequest,
RealtimeTranslationClientEvent,
RealtimeTranslationClientSecretCreateRequest,
RealtimeTranslationClientSecretCreateResponse,
RealtimeTranslationInputAudioBufferAppendEvent,
RealtimeTranslationInputTranscriptDeltaEvent,
RealtimeTranslationOutputAudioDeltaEvent,
RealtimeTranslationOutputTranscriptDeltaEvent,
RealtimeTranslationServerEvent,
RealtimeTranslationSession,
RealtimeTranslationSessionCloseEvent,
RealtimeTranslationSessionClosedEvent,
RealtimeTranslationSessionCreateRequest,
RealtimeTranslationSessionCreatedEvent,
RealtimeTranslationSessionUpdateEvent,
RealtimeTranslationSessionUpdateRequest,
RealtimeTranslationSessionUpdatedEvent,
RealtimeTruncation,
RealtimeTruncationRetentionRatio,
ResponseAudioDeltaEvent,
Expand Down Expand Up @@ -114,7 +132,6 @@ Types:

```python
from openai.types.realtime import (
RealtimeSessionClientSecret,
RealtimeSessionCreateResponse,
RealtimeTranscriptionSessionCreateResponse,
RealtimeTranscriptionSessionTurnDetection,
Expand Down
21 changes: 21 additions & 0 deletions src/openai/resources/realtime/calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
call_reject_params,
)
from ...types.responses.response_prompt_param import ResponsePromptParam
from ...types.realtime.realtime_reasoning_param import RealtimeReasoningParam
from ...types.realtime.realtime_truncation_param import RealtimeTruncationParam
from ...types.realtime.realtime_audio_config_param import RealtimeAudioConfigParam
from ...types.realtime.realtime_tools_config_param import RealtimeToolsConfigParam
Expand Down Expand Up @@ -121,6 +122,7 @@ def accept(
Literal[
"gpt-realtime",
"gpt-realtime-1.5",
"gpt-realtime-2",
"gpt-realtime-2025-08-28",
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
Expand All @@ -139,7 +141,9 @@ def accept(
]
| Omit = omit,
output_modalities: List[Literal["text", "audio"]] | Omit = omit,
parallel_tool_calls: bool | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
reasoning: RealtimeReasoningParam | Omit = omit,
tool_choice: RealtimeToolChoiceConfigParam | Omit = omit,
tools: RealtimeToolsConfigParam | Omit = omit,
tracing: Optional[RealtimeTracingConfigParam] | Omit = omit,
Expand Down Expand Up @@ -188,9 +192,14 @@ def accept(
can be used to make the model respond with text only. It is not possible to
request both `text` and `audio` at the same time.

parallel_tool_calls: Whether the model may call multiple tools in parallel. Only supported by
reasoning Realtime models such as `gpt-realtime-2`.

prompt: Reference to a prompt template and its variables.
[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

reasoning: Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.

tool_choice: How the model chooses tools. Provide one of the string modes or force a specific
function/MCP tool.

Expand Down Expand Up @@ -245,7 +254,9 @@ def accept(
"max_output_tokens": max_output_tokens,
"model": model,
"output_modalities": output_modalities,
"parallel_tool_calls": parallel_tool_calls,
"prompt": prompt,
"reasoning": reasoning,
"tool_choice": tool_choice,
"tools": tools,
"tracing": tracing,
Expand Down Expand Up @@ -471,6 +482,7 @@ async def accept(
Literal[
"gpt-realtime",
"gpt-realtime-1.5",
"gpt-realtime-2",
"gpt-realtime-2025-08-28",
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
Expand All @@ -489,7 +501,9 @@ async def accept(
]
| Omit = omit,
output_modalities: List[Literal["text", "audio"]] | Omit = omit,
parallel_tool_calls: bool | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
reasoning: RealtimeReasoningParam | Omit = omit,
tool_choice: RealtimeToolChoiceConfigParam | Omit = omit,
tools: RealtimeToolsConfigParam | Omit = omit,
tracing: Optional[RealtimeTracingConfigParam] | Omit = omit,
Expand Down Expand Up @@ -538,9 +552,14 @@ async def accept(
can be used to make the model respond with text only. It is not possible to
request both `text` and `audio` at the same time.

parallel_tool_calls: Whether the model may call multiple tools in parallel. Only supported by
reasoning Realtime models such as `gpt-realtime-2`.

prompt: Reference to a prompt template and its variables.
[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).

reasoning: Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`.

tool_choice: How the model chooses tools. Provide one of the string modes or force a specific
function/MCP tool.

Expand Down Expand Up @@ -595,7 +614,9 @@ async def accept(
"max_output_tokens": max_output_tokens,
"model": model,
"output_modalities": output_modalities,
"parallel_tool_calls": parallel_tool_calls,
"prompt": prompt,
"reasoning": reasoning,
"tool_choice": tool_choice,
"tools": tools,
"tracing": tracing,
Expand Down
4 changes: 3 additions & 1 deletion src/openai/types/realtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .call_accept_params import CallAcceptParams as CallAcceptParams
from .call_create_params import CallCreateParams as CallCreateParams
from .call_reject_params import CallRejectParams as CallRejectParams
from .realtime_reasoning import RealtimeReasoning as RealtimeReasoning
from .audio_transcription import AudioTranscription as AudioTranscription
from .log_prob_properties import LogProbProperties as LogProbProperties
from .realtime_truncation import RealtimeTruncation as RealtimeTruncation
Expand Down Expand Up @@ -38,11 +39,13 @@
from .realtime_response_usage import RealtimeResponseUsage as RealtimeResponseUsage
from .realtime_tracing_config import RealtimeTracingConfig as RealtimeTracingConfig
from .mcp_list_tools_completed import McpListToolsCompleted as McpListToolsCompleted
from .realtime_reasoning_param import RealtimeReasoningParam as RealtimeReasoningParam
from .realtime_response_status import RealtimeResponseStatus as RealtimeResponseStatus
from .response_mcp_call_failed import ResponseMcpCallFailed as ResponseMcpCallFailed
from .response_text_done_event import ResponseTextDoneEvent as ResponseTextDoneEvent
from .audio_transcription_param import AudioTranscriptionParam as AudioTranscriptionParam
from .rate_limits_updated_event import RateLimitsUpdatedEvent as RateLimitsUpdatedEvent
from .realtime_reasoning_effort import RealtimeReasoningEffort as RealtimeReasoningEffort
from .realtime_truncation_param import RealtimeTruncationParam as RealtimeTruncationParam
from .response_audio_done_event import ResponseAudioDoneEvent as ResponseAudioDoneEvent
from .response_text_delta_event import ResponseTextDeltaEvent as ResponseTextDeltaEvent
Expand Down Expand Up @@ -75,7 +78,6 @@
from .conversation_item_delete_event import ConversationItemDeleteEvent as ConversationItemDeleteEvent
from .input_audio_buffer_clear_event import InputAudioBufferClearEvent as InputAudioBufferClearEvent
from .realtime_mcp_approval_response import RealtimeMcpApprovalResponse as RealtimeMcpApprovalResponse
from .realtime_session_client_secret import RealtimeSessionClientSecret as RealtimeSessionClientSecret
from .conversation_item_created_event import ConversationItemCreatedEvent as ConversationItemCreatedEvent
from .conversation_item_deleted_event import ConversationItemDeletedEvent as ConversationItemDeletedEvent
from .input_audio_buffer_append_event import InputAudioBufferAppendEvent as InputAudioBufferAppendEvent
Expand Down
15 changes: 12 additions & 3 deletions src/openai/types/realtime/audio_transcription.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@


class AudioTranscription(BaseModel):
delay: Optional[Literal["minimal", "low", "medium", "high", "xhigh"]] = None
"""
Controls how long the model waits before emitting transcription text. Higher
values can improve transcription accuracy at the cost of latency. Only supported
with `gpt-realtime-whisper` in GA Realtime sessions.
"""

language: Optional[str] = None
"""The language of the input audio.

Expand All @@ -25,15 +32,16 @@ class AudioTranscription(BaseModel):
"gpt-4o-mini-transcribe-2025-12-15",
"gpt-4o-transcribe",
"gpt-4o-transcribe-diarize",
"gpt-realtime-whisper",
],
None,
] = None
"""The model to use for transcription.

Current options are `whisper-1`, `gpt-4o-mini-transcribe`,
`gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and
`gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need
diarization with speaker labels.
`gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`,
`gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use
`gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
"""

prompt: Optional[str] = None
Expand All @@ -43,4 +51,5 @@ class AudioTranscription(BaseModel):
[prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the
prompt is a free text string, for example "expect words related to technology".
Prompt is not supported with `gpt-realtime-whisper` in GA Realtime sessions.
"""
15 changes: 12 additions & 3 deletions src/openai/types/realtime/audio_transcription_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@


class AudioTranscriptionParam(TypedDict, total=False):
delay: Literal["minimal", "low", "medium", "high", "xhigh"]
"""
Controls how long the model waits before emitting transcription text. Higher
values can improve transcription accuracy at the cost of latency. Only supported
with `gpt-realtime-whisper` in GA Realtime sessions.
"""

language: str
"""The language of the input audio.

Expand All @@ -25,14 +32,15 @@ class AudioTranscriptionParam(TypedDict, total=False):
"gpt-4o-mini-transcribe-2025-12-15",
"gpt-4o-transcribe",
"gpt-4o-transcribe-diarize",
"gpt-realtime-whisper",
],
]
"""The model to use for transcription.

Current options are `whisper-1`, `gpt-4o-mini-transcribe`,
`gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and
`gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need
diarization with speaker labels.
`gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`,
`gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use
`gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
"""

prompt: str
Expand All @@ -42,4 +50,5 @@ class AudioTranscriptionParam(TypedDict, total=False):
[prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).
For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the
prompt is a free text string, for example "expect words related to technology".
Prompt is not supported with `gpt-realtime-whisper` in GA Realtime sessions.
"""
11 changes: 11 additions & 0 deletions src/openai/types/realtime/call_accept_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import List, Union, Optional
from typing_extensions import Literal, Required, TypedDict

from .realtime_reasoning_param import RealtimeReasoningParam
from .realtime_truncation_param import RealtimeTruncationParam
from .realtime_audio_config_param import RealtimeAudioConfigParam
from .realtime_tools_config_param import RealtimeToolsConfigParam
Expand Down Expand Up @@ -57,6 +58,7 @@ class CallAcceptParams(TypedDict, total=False):
Literal[
"gpt-realtime",
"gpt-realtime-1.5",
"gpt-realtime-2",
"gpt-realtime-2025-08-28",
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
Expand All @@ -83,12 +85,21 @@ class CallAcceptParams(TypedDict, total=False):
only. It is not possible to request both `text` and `audio` at the same time.
"""

parallel_tool_calls: bool
"""Whether the model may call multiple tools in parallel.

Only supported by reasoning Realtime models such as `gpt-realtime-2`.
"""

prompt: Optional[ResponsePromptParam]
"""
Reference to a prompt template and its variables.
[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
"""

reasoning: RealtimeReasoningParam
"""Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`."""

tool_choice: RealtimeToolChoiceConfigParam
"""How the model chooses tools.

Expand Down
3 changes: 3 additions & 0 deletions src/openai/types/realtime/realtime_audio_config_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ class RealtimeAudioConfigInput(BaseModel):
trails off with "uhhm", the model will score a low probability of turn end and
wait longer for the user to continue speaking. This can be useful for more
natural conversations, but may have a higher latency.
For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
`null`; VAD is not supported.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ class RealtimeAudioConfigInputParam(TypedDict, total=False):
trails off with "uhhm", the model will score a low probability of turn end and
wait longer for the user to continue speaking. This can be useful for more
natural conversations, but may have a higher latency.
For `gpt-realtime-whisper` transcription sessions, turn detection must be set to
`null`; VAD is not supported.
"""
18 changes: 18 additions & 0 deletions src/openai/types/realtime/realtime_reasoning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from ..._models import BaseModel
from .realtime_reasoning_effort import RealtimeReasoningEffort

__all__ = ["RealtimeReasoning"]


class RealtimeReasoning(BaseModel):
"""Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`."""

effort: Optional[RealtimeReasoningEffort] = None
"""
Constrains effort on reasoning for reasoning-capable Realtime models such as
`gpt-realtime-2`.
"""
7 changes: 7 additions & 0 deletions src/openai/types/realtime/realtime_reasoning_effort.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing_extensions import Literal, TypeAlias

__all__ = ["RealtimeReasoningEffort"]

RealtimeReasoningEffort: TypeAlias = Literal["minimal", "low", "medium", "high", "xhigh"]
19 changes: 19 additions & 0 deletions src/openai/types/realtime/realtime_reasoning_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import TypedDict

from .realtime_reasoning_effort import RealtimeReasoningEffort

__all__ = ["RealtimeReasoningParam"]


class RealtimeReasoningParam(TypedDict, total=False):
"""Configuration for reasoning-capable Realtime models such as `gpt-realtime-2`."""

effort: RealtimeReasoningEffort
"""
Constrains effort on reasoning for reasoning-capable Realtime models such as
`gpt-realtime-2`.
"""
Loading
Loading