Change8

OpenAI Python SDK

AI & LLMs

The official Python library for the OpenAI API

Latest: v2.45.0100 releases7 breaking changes10 common errorsView on GitHub

Release History

v2.45.0
Jul 9, 2026
v2.44.01 fix
Jun 24, 2026

Release 2.44.0 primarily addresses a bug in authentication header prioritization.

v2.43.01 feature
Jun 17, 2026

Release 2.43.0 primarily updates the underlying OpenAPI specification or Stainless configuration.

v2.42.03 features
Jun 16, 2026

This release introduces new API features including admin spend alerts, manual updates, and OpenAPI spec configuration updates.

v2.41.1
Jun 10, 2026

This patch release primarily addresses internal build system maintenance by removing a scheduled release workflow trigger.

v2.41.01 feature
Jun 3, 2026

This release introduces new features allowing direct access to moderation results on API responses for both general responses and chat completions.

v2.40.01 fix1 feature
Jun 1, 2026

This release introduces support for Amazon Bedrock Responses and fixes an issue allowing Bedrock API keys to be set directly on the client.

v2.39.03 features
Jun 1, 2026

This release introduces new features related to audit logs, response structures, and optional query parameters in ActionSearch.

v2.38.03 features
May 21, 2026

This release primarily focuses on updating the underlying API specifications and configurations. It includes several minor API updates and associated chore work.

v2.37.01 fix3 features
May 15, 2026

Release 2.37.0 introduces API enhancements like the service_tier parameter and internal validation improvements, alongside removing an unnecessary client ID for workload identity authentication.

v2.36.02 features
May 7, 2026

This release introduces manual API updates and new Realtime 2 API capabilities.

v2.35.11 fix
May 6, 2026

Version 2.35.1 addresses a specific bug fix related to the image generation API size enumeration.

v2.35.02 features
May 6, 2026

This release introduces updates to the image API and includes chores related to removing and renaming the legacy Python CLI entrypoint. Documentation for top_logprobs has also been updated.

v2.34.011 fixes5 features
May 4, 2026

This release introduces support for setting headers via environment variables and adds functionality for Admin API Keys per endpoint. It also includes numerous bug fixes related to authentication handling and type corrections in response models.

v2.33.01 fix1 feature
Apr 28, 2026

This release includes an API update and fixes a bug related to the prompt_cache_retention enum value.

v2.32.01 fix5 features
Apr 15, 2026

This release introduces significant enhancements to websocket handling, including event handlers, reconnection support, and the ability to enqueue messages when disconnected. It also adds detail to InputFileContent and the OAuthErrorCode type.

v2.31.02 fixes5 features
Apr 8, 2026

This release introduces support for short-lived tokens, raw websocket data transmission, and updates API message structures, while also correcting an inconsistency regarding the 'web_search_call.results' field in ResponseIncludable.

v2.30.03 fixes1 feature
Mar 25, 2026

Version 2.30.0 introduces new fields for computer actions and includes several bug fixes related to API response types and input validation.

v2.29.02 fixes4 features
Mar 17, 2026

This release introduces new model slugs, adds video batch creation support, and includes several API enhancements along with minor dependency and serialization fixes.

v2.28.01 feature
Mar 13, 2026

This release introduces support for custom voices via the API.

v2.27.01 fix2 features
Mar 13, 2026

This release introduces significant updates to the API, including enhancements for Sora video capabilities, and resolves a bug in the merged videos resource.

v2.26.0Breaking1 feature
Mar 5, 2026

This release updates the GA ComputerTool to use the ComputerTool class and moves the 'computer_use_preview' tool to 'ComputerUsePreview'.

v2.25.03 fixes2 features
Mar 5, 2026

This release introduces support for new models and tools, while simultaneously removing the `prompt_cache_key` parameter and the `phase` field from message types.

v2.24.02 fixes1 feature
Feb 24, 2026

This release introduces API support for the 'phase' field and includes related bug fixes and documentation updates.

v2.23.01 feature
Feb 24, 2026

Version 2.23.0 introduces new model options for realtime API interactions, specifically gpt-realtime-1.5 and gpt-audio-1.5.

v2.22.01 feature
Feb 23, 2026

This release introduces websocket support for the responses API and includes various documentation enhancements across several API endpoints.

v2.21.02 fixes1 feature
Feb 14, 2026

Version 2.21.0 introduces new API capabilities for container network policy and skills, alongside fixes for memory leaks in structured output parsing.

v2.20.01 feature
Feb 10, 2026

Version 2.20.0 introduces support for images within the batch API operations.

v2.19.01 feature
Feb 10, 2026

Version 2.19.0 introduces new API capabilities for skills and hosted shell support, along with internal dependency bumps.

v2.18.01 feature
Feb 9, 2026

This release introduces the addition of the context_management field to API responses.

v2.17.02 fixes3 features
Feb 5, 2026

Release 2.17.0 introduces new API fields for shell output and image generation actions, alongside client improvements for JSON encoding. Several minor client-side bug fixes related to web search actions were also addressed.

v2.16.02 features
Jan 27, 2026

This release introduces support for binary request streaming and includes general API updates. Additionally, the Assistants API endpoints have been marked as deprecated.

v2.15.01 feature
Jan 9, 2026

This release introduces a new `completed_at` property on the Response object for API interactions and includes internal code generation updates.

v2.14.01 fix2 features
Dec 19, 2025

This release introduces support for new audio model slugs and allows all model parameters to accept string inputs, alongside a fix for the patch method using async file handling.

v2.13.01 feature
Dec 16, 2025

This release introduces support for the new gpt-image-1.5 model and includes internal CI/chore updates.

v2.12.02 features
Dec 15, 2025

This release includes general API updates and specific fixes related to grader input lists and sora-2 dated slugs.

v2.11.01 feature
Dec 11, 2025

This release introduces support for the new gpt 5.2 model via the API.

v2.10.01 fix1 feature
Dec 10, 2025

Version 2.10.0 makes the model parameter mandatory for the responses/compact endpoint and fixes a type inference issue for pyright.

v2.9.03 fixes1 feature
Dec 4, 2025

This release introduces support for the new gpt-5.1-codex-max model and includes several bug fixes related to stream closing and client configuration mutation. A temporary pin on mypy was also introduced due to a regression in version 1.18.1.

v2.8.11 fix
Nov 17, 2025

Version 2.8.1 primarily addresses a bug fix related to aligning input and output item types for better TypeScript compatibility within the API.

v2.8.01 fix1 feature
Nov 13, 2025

This release introduces support for the gpt 5.1 model and includes a bug fix related to Pydantic v1 compatibility for model serialization methods.

v2.7.2Breaking1 fix
Nov 10, 2025

This patch release fixes Python 3.14 compatibility and officially drops support for Python 3.8.

v2.7.11 fix
Nov 4, 2025

Version 2.7.1 is a patch release primarily focused on fixing a bug concerning the nullability of logprobs in API responses.

v2.7.03 fixes3 features
Nov 3, 2025

This release introduces support for Realtime API token limits and new hybrid search ranking options. It also includes several bug fixes, notably ensuring streams are properly closed and preventing file handle leaks.

v2.6.11 fix
Oct 24, 2025

Version 2.6.1 primarily contains minor bug fixes, specifically updating API documentation, alongside internal code cleanup.

v2.6.01 fix1 feature
Oct 20, 2025

Version 2.6.0 introduces a new field for token counts in API responses and incorporates internal OpenAPI specification updates.

v2.5.01 feature
Oct 17, 2025

This release introduces an API update and bumps the dependency version for httpx-aiohttp.

v2.4.01 feature
Oct 16, 2025

Version 2.4.0 introduces support for the gpt-4o-transcribe-diarize model on the audio transcription endpoint and includes minor internal chore updates.

v2.3.01 feature
Oct 10, 2025

This release introduces new comparison filter capabilities for the API and updates dependencies to ensure compatibility with Python 3.14.

v2.2.01 fix1 feature
Oct 6, 2025

Version 2.2.0 introduces support for new API features from dev day 2025 and includes a minor bug fix related to beta resources.

v2.1.01 feature
Oct 2, 2025

Version 2.1.0 introduces support for realtime API calls. This release focuses on expanding real-time interaction capabilities.

v2.0.11 fix
Oct 1, 2025

This patch release includes a bug fix for MCP tool calls, adding missing status and approval request ID fields.

v2.0.0Breaking2 features
Sep 30, 2025

This major release introduces support for multi-modal function call outputs (images and files) and BatchUsage, while changing the output type of tool call response items from string to a union type.

v1.109.11 fix
Sep 24, 2025

This patch release addresses a compatibility bug with older versions of Pydantic when handling additional fields.

v1.109.01 feature
Sep 23, 2025

This release introduces support for the gpt-5-codex model to the OpenAI Python SDK.

v1.108.21 fix1 feature
Sep 22, 2025

This patch release focuses on fixing MCP tool naming and updating OpenAPI definitions for conversations, alongside minor internal script improvements.

v1.108.1Breaking1 feature
Sep 19, 2025

This release introduces the reasoning_text field to the API and updates internal type handling for optional parameters from NotGiven to Omit.

v1.108.01 feature
Sep 17, 2025

This release introduces type updates for conversations and reasoning effort in evaluations, alongside internal Pydantic dependency maintenance.

v1.107.3
Sep 15, 2025

This is a maintenance release focused on internal API documentation refactoring, specification updates, and test simplification.

v1.107.2
Sep 12, 2025

This patch release includes minor documentation and type updates for the realtime API, along with internal test simplifications.

v1.107.11 fix
Sep 10, 2025

This patch release focuses on correcting type definitions for the Realtime API following its General Availability.

v1.107.01 feature
Sep 8, 2025

This release introduces the API shape for RealtimeGA and includes internal codegen updates.

v1.106.1
Sep 4, 2025

This patch release focuses on internal maintenance by moving mypy configurations to the pyproject.toml file.

v1.106.02 features
Sep 4, 2025

This release introduces support for dynamic API keys via callables and enhances forward compatibility with Pydantic v3.

v1.105.01 feature
Sep 3, 2025

This release introduces support for the new gpt-realtime models in the OpenAI API.

v1.104.21 fix
Sep 2, 2025

Version 1.104.2 is a maintenance patch that restores type aliases for web search tools to fix potential type-checking regressions.

v1.104.11 feature
Sep 2, 2025

This patch release includes manual updates to the ResponseInputAudio API components.

v1.104.01 fix1 feature
Sep 2, 2025

This release focuses on internal type safety improvements by replacing List[str] with SequenceNotStr in various parameter definitions.

v1.103.01 fix1 feature
Sep 2, 2025

This release introduces updates to the Realtime API and fixes a bug where parameters were missing from the stream() method.

v1.102.01 fix1 feature
Aug 26, 2025

This release introduces web search filters to the API and fixes a bug related to modern type syntax usage.

v1.101.02 features
Aug 21, 2025

This release introduces support for the /v1/conversations endpoint and adds connector support for MCP tools.

v1.100.3
Aug 20, 2025

This is a maintenance release focused on internal CI improvements, specifically setting up breaking change detection.

v1.100.21 fix
Aug 19, 2025

This patch release updates the internal API representation for the verbosity parameter in Chat Completions to ensure accurate data shaping.

v1.100.11 fix
Aug 18, 2025

This patch release reverts an accidental deletion of response text configuration types to ensure type consistency.

v1.100.01 feature
Aug 18, 2025

This release introduces new text parameters and expiration options to the API.

v1.99.91 fix
Aug 12, 2025

This patch release specifically addresses a typing issue within the ChatCompletionMessageToolCall class.

v1.99.82 fixes
Aug 11, 2025

Release 1.99.8 focuses on internal test improvements and reverts a breaking change to the ChatCompletionMessageToolCallUnion type.

v1.99.7Breaking2 fixes
Aug 11, 2025

Release 1.99.7 focuses on fixing type definitions by reverting ChatCompletionMessageToolCallParam to a TypedDict.

v1.99.61 fix
Aug 9, 2025

This release focuses on improving type exports for tool calls and internal maintenance updates.

v1.99.51 fix
Aug 8, 2025

This patch release fixes a bug regarding the location of the verbosity parameter within the Responses class.

v1.99.4Breaking2 fixes
Aug 8, 2025

This patch release focuses on type definition fixes, specifically reverting ChatCompletionToolParam to a TypedDict and renaming internal chat completion tool types.

v1.99.31 fix
Aug 8, 2025

This patch release restores the missing 'output_text' field to response objects.

v1.99.21 fix1 feature
Aug 7, 2025

This release introduces support for GPT-5 and associated API features, alongside a fix for tool-related type definitions.

v1.99.11 fix
Aug 5, 2025

This patch release addresses a bug regarding internal event imports.

v1.99.01 fix2 features
Aug 5, 2025

This release introduces support for file upload requests and adds missing prompt cache parameters to the client.

v1.98.01 feature
Jul 30, 2025

This release includes manual updates to the API.

v1.97.2
Jul 30, 2025

This patch release includes internal refactoring of the streaming client for future-proofing and adds VS Code project settings.

v1.97.12 fixes
Jul 22, 2025

This patch release focuses on improving parsing logic for metadata and extra field types, alongside internal API event shape refinements.

v1.97.01 feature
Jul 16, 2025

This release includes manual updates to the API definitions.

v1.96.11 feature
Jul 15, 2025

This patch release updates the internal Realtime API specifications.

v1.96.02 features
Jul 15, 2025

This release focuses on internal maintenance, including environment call-out cleanup and updates to the Realtime API specifications.

v1.95.11 fix
Jul 11, 2025

This patch release fixes a bug in the client where Content-Type headers were incorrectly being sent during GET requests.

v1.95.01 fix2 features
Jul 10, 2025

This release introduces file_url support to the API and includes minor fixes for event IDs and README rendering on PyPI.

v1.94.01 feature
Jul 10, 2025

Release 1.94.0 improves API error messaging specifically for missing embeddings.

v1.93.31 fix
Jul 9, 2025

This patch release addresses a bug in the parsing logic to correctly handle nested discriminated unions.

v1.93.21 feature
Jul 8, 2025

This maintenance release adds official support for Python 3.13 and updates the internal h11 dependency constraint.

v1.93.14 fixes
Jul 7, 2025

This patch release focuses on fixing missing arguments in vector store file polling methods and response parsing, alongside CI improvements.

v1.93.01 feature
Jun 27, 2025

This release introduces CLI support for managing fine-tuning jobs.

v1.92.31 fix
Jun 27, 2025

This patch release fixes an encoding error triggered by empty API keys and updates documentation regarding macOS requirements for realtime examples.

v1.92.2Breaking
Jun 26, 2025

This maintenance release removes an unsupported 'api' property from the library.

Common Errors

BadRequestError24 reports

BadRequestError in openai-python-sdk usually arises from malformed requests sent to the OpenAI API. This can happen due to incorrect data types, missing required parameters, or invalid values in your API request. To fix, carefully validate your request data against the OpenAI API documentation for the specific endpoint you are using, paying close attention to the expected schema and data types; also, ensure your pydantic models correctly reflect the expected schema if using them.

NotFoundError8 reports

The "NotFoundError" in the openai-python-sdk often arises from using an incorrect or unsupported API endpoint, particularly with Azure OpenAI or preview API versions. To resolve this, double-check that the API endpoint, deployment name, and API version are accurate and supported by your Azure OpenAI service and model. Ensure that the requested functionality (e.g., edits, tools) is available for the specific model and API version you're using.

InternalServerError3 reports

"InternalServerError" errors in the OpenAI Python SDK often indicate a problem on OpenAI's server-side, or issues in the request that the server cannot properly process. To fix it, first, ensure your request data is correctly formatted and validated against the API documentation, especially for complex types like `decimal.Decimal` fields or file content requests. If the issue persists, consider implementing retry logic with exponential backoff to handle temporary server hiccups and report the issue to OpenAI support if it continues.

LengthFinishReasonError2 reports

LengthFinishReasonError usually means the OpenAI API stopped generating tokens because it hit the `max_tokens` limit you specified in your request. Increase the `max_tokens` parameter in your API call to allow the model to complete its response, or consider streaming the response to handle potentially long outputs.

ImportError1 report

This ImportError often arises due to inconsistencies between the openai package version and its dependencies, particularly when dealing with streaming functionality. To resolve this, upgrade the `openai` package and its dependencies, especially `requests` and `urllib3`, using pip: `pip install --upgrade openai requests urllib3`. If the error persists, try creating a new virtual environment to ensure a clean installation.

JSONDecodeError1 report

JSONDecodeError often arises when the response from the OpenAI API is malformed JSON or contains non-JSON data (e.g., SSE retry events). Implement robust error handling by checking if the response line is valid JSON before attempting to parse it; you may need to skip lines that are not JSON objects (e.g., retry events) or use a try-except block to catch and handle JSONDecodeError exceptions, logging the error and potentially retrying the request. Specifically, handle the case where the data field might be missing.

Related AI & LLMs Packages

Subscribe to Updates

Get notified when new versions are released

RSS Feed