OpenAI’s official Python library for building applications that use the OpenAI API. Useful for developers who want to authenticate and make API requests from Python.
Project status
- Actively maintained: The repository shows frequent updates and a very recent upstream push (2026-06-25), with the latest published update v2.44.0 on 2026-06-24.
- Update cadence: Recent versions land roughly about weekly (v2.44.0 6/24, v2.43.0 6/17, v2.42.0 6/16, v2.41.1 6/10, v2.41.0 6/03), suggesting an active development stream rather than a long maintenance gap.
AI summary generated
Recent updates
v2.45.0
v2.45.0 is a small release in the notes, highlighting an update to the gpt-5.6-sol API integration, and a bug fix restoring beta resource accessors. The actual diff is much larger, with substantial additions to beta type exports and internal response parsing improvements.
v2.44.0
Release v2.44.0 notes only mention a small auth bug fix, prioritizing the first auth header. The actual diff, however, includes a much larger internal refactor centered on Bedrock authentication plus a new provider abstraction that changes how authentication and base URL routing are configured.
v2.43.0
v2.43.0 primarily reflects an OpenAPI/Stainless regeneration. The only substantive code change visible in the diff is the addition of support for a Secure MCP Tunnel option via a new `tunnel_id` field in multiple MCP tool/config type definitions.
Featuresv2.42.0
v2.42.0 adds new admin capabilities and expands several typed API surfaces. The main functional changes visible in the diff include new admin spend alert retrieval endpoints and new support for expiring admin API keys, plus expanded audit log filtering and additional audit event detail types.
Featuresv2.41.1
Release v2.41.1 contains only build and release-process related changes, plus the expected version bump to 2.41.1. The published release notes mention only removal of the scheduled workflow trigger, but the code diff shows a larger refactor of the PyPI publishing pipeline.
v2.41.0
v2.41.0 adds moderation support to both the Responses API and Chat Completions API. The change introduces a new optional `moderation` configuration (currently only a `model` field) and extends response/chunk models to carry moderation results when that option is used.
Featuresv2.40.0
v2.40.0 adds support for Amazon Bedrock's OpenAI-compatible “Responses” API by introducing BedrockOpenAI and AsyncBedrockOpenAI clients. It also improves configuration so Bedrock API keys can be set directly on the client/module client. The bulk of the change is new Bedrock-specific client logic plus wiring into the library’s module client selection.
Featuresv2.39.0
v2.39.0 adds new Admin Organization audit log event types for workload identity providers, and introduces support for an additional_tools item in Responses/Conversation parsing. It also updates ActionSearch.query handling to be optional as described in the release notes. The code diff additionally introduces a new request parameter (personality) and updates prompt cache retention documentation, neither of which are mentioned in the release notes.
Featuresv2.38.0
Release v2.38.0 contains a largely automated OpenAPI/Stainless update, reflected by a very large number of generated model/type additions (+9938 lines, -18 lines deleted). The release notes are high-level and do not explicitly list concrete API surface changes, fixes, or breaking behavior.
v2.37.0
v2.37.0 adds a new optional request parameter, `service_tier`, to the Responses `compact` method. It also improves request validation for Pydantic iterators by eagerly validating iterable inputs, and adjusts workload identity auth to stop sending an unnecessary `client_id`.
BreakingFeaturesv2.36.0
v2.36.0 is a Realtime-focused release that expands the SDK surface for a new reasoning-capable model family and a new whisper transcription path. The release notes only mention “manual updates” and “realtime 2”, but the code also introduces new configuration types, new model enum values, and a Realtime session response shape change that is not called out in the notes.
Featuresv2.35.1
This is a targeted patch release that fixes a regression in image generation size handling. The generated client types and image resource signatures were regenerated to explicitly enumerate supported size values, while the runtime behavior appears unchanged beyond the accepted request schema.
v2.35.0
v2.35.0 is mostly a cleanup and API-refresh release: it updates image-related API support, applies manual schema/API adjustments, and removes the legacy Python CLI entrypoint. The diff is dominated by deleting the old CLI implementation, so most of the user-visible impact is around command-line tooling rather than core SDK behavior.
BreakingFeaturesv2.34.0
This release expands the SDK's admin-API surface and refactors authentication so credentials can be selected per request, while also adding env-driven custom headers and several auth/type fixes. It also includes a multipart-copy performance optimization and a broad set of generated admin/manual endpoint updates.
Featuresv2.33.0
This release is a small OpenAPI-driven refresh of the generated OpenAI Python client. The only explicitly documented user-facing change is a prompt-cache enum correction from `in-memory` to `in_memory`, alongside a general API update and CI cleanup.
BreakingFeaturesv2.32.0
v2.32.0 adds richer input-file metadata and significantly expands the websocket stack with reconnect support, event-handler hooks, and buffered sends for realtime/streaming clients. It also includes a serialization bug fix for file data and refreshed examples.
Featuresv2.31.0
v2.31.0 adds support for short‑lived tokens, sending raw data over WebSockets, and a new conversations.message.phase field. It also fixes query‑param merging to preserve hardcoded params and adjusts type definitions (removal of web_search_call.results from ResponseIncludable), which may require minor changes for typed clients.
BreakingFeaturesv2.30.0
v2.30.0 adds a new keys field for several computer (mouse) actions and tightens SDK response typings/schema alignment. Important type/response-shape changes (including making ResponseInputMessageItem.type required) may require code/type updates before upgrading.
BreakingFeaturesv2.29.0
This release (v2.29.0) adds support for new model slugs (5.4 nano and mini), extends the Batches create API to accept a /v1/videos endpoint, introduces new fields/operators (ToolFunction.defer_loading and ComparisonFilter 'in'/'nin'), and includes a couple of compatibility bug fixes. Developers should pay attention to a dependency bump for typing-extensions and a change in pydantic serialization behavior that may affect output shape.
BreakingFeaturesv2.28.0
This release adds first-class support for custom voices in the client API, enabling use of custom voice models (likely for text-to-speech/audio) from the SDK. No other changes or breaking changes are documented in the release notes, so upgrade risk appears low—review the API docs for the new endpoints/methods before adopting.
Features