# openai-python

> The official Python library for the OpenAI API

- **URL**: https://www.freshcrate.ai/projects/openai-python
- **Author**: openai
- **Category**: Uncategorized
- **Latest version**: `v2.40.0` (2026-06-01)
- **License**: Apache-2.0
- **Source**: https://github.com/openai/openai-python
- **Homepage**: https://pypi.org/project/openai/
- **Language**: Python
- **GitHub**: 30,550 stars, 4,730 forks
- **Registry**: github
- **Tags**: `openai`, `python`

## Description

The official Python library for the OpenAI API

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v2.40.0` | 2026-06-01 | High | ## 2.40.0 (2026-06-01)  Full Changelog: [v2.39.0...v2.40.0](https://github.com/openai/openai-python/compare/v2.39.0...v2.40.0)  ### Features * **api:** Add Amazon Bedrock Responses support   ### Bug Fixes  * **api:** allow setting bedrock api keys on the client directly ([4d5bfde](https://github.com/openai/openai-python/commit/4d5bfdec37fa8a2b2a0413724755e586e627e28d)) |
| `v2.38.0` | 2026-05-21 | High | ## 2.38.0 (2026-05-21)  Full Changelog: [v2.37.0...v2.38.0](https://github.com/openai/openai-python/compare/v2.37.0...v2.38.0)  ### Features  * **api:** api update ([33d1d01](https://github.com/openai/openai-python/commit/33d1d013250053886a73d178136e6bd1b09df059)) * **api:** manual updates ([a21700a](https://github.com/openai/openai-python/commit/a21700a2cd510cb9e6c88065ac8e942d4c041aa8)) * **api:** update OpenAPI spec or Stainless config ([00265c5](https://github.com/openai/openai-python/commit |
| `v2.37.0` | 2026-05-15 | High | ## 2.37.0 (2026-05-13)  Full Changelog: [v2.36.0...v2.37.0](https://github.com/openai/openai-python/compare/v2.36.0...v2.37.0)  ### Features  * **api:** add service_tier parameter to responses compact method ([625827c](https://github.com/openai/openai-python/commit/625827c5509ece3c40e5002be37a9bd9d91b5374)) * **internal/types:** support eagerly validating pydantic iterators ([7e527bc](https://github.com/openai/openai-python/commit/7e527bc927cc58b74d7619abf7f1fbcfff8bddfa)) * Remove unnecessary c |
| `v2.36.0` | 2026-05-07 | High | ## 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)) |
| `v2.34.0` | 2026-05-04 | High | ## 2.34.0 (2026-05-04)  Full Changelog: [v2.33.0...v2.34.0](https://github.com/openai/openai-python/compare/v2.33.0...v2.34.0)  ### Features  * **api:** add external_key_id to projects, email/metadata params to users, update types ([2d232ee](https://github.com/openai/openai-python/commit/2d232eebb2fe021bb21f2576b17d1d588f81a608)) * **api:** add support for Admin API Keys per endpoint ([b8b176a](https://github.com/openai/openai-python/commit/b8b176af84172f27d2fde8dca062ca4c41f94bf7)) * **api:** a |
| `v2.33.0` | 2026-04-28 | High | ## 2.33.0 (2026-04-28)  Full Changelog: [v2.32.0...v2.33.0](https://github.com/openai/openai-python/compare/v2.32.0...v2.33.0)  ### Features  * **api:** api update ([18f834a](https://github.com/openai/openai-python/commit/18f834a54f92ea827452471a46a4f442f251e2c8))   ### Bug Fixes  * **api:** correct prompt_cache_retention enum value from in-memory to in_memory ([#1822](https://github.com/openai/openai-python/issues/1822)) ([f9d2d13](https://github.com/openai/openai-python/commit/f9d2d1359688a624 |
| `v2.32.0` | 2026-04-15 | High | ## 2.32.0 (2026-04-15)  Full Changelog: [v2.31.0...v2.32.0](https://github.com/openai/openai-python/compare/v2.31.0...v2.32.0)  ### Features  * **api:** Add detail to InputFileContent ([60de21d](https://github.com/openai/openai-python/commit/60de21d1fcfbcadea0d9b8d884c73c9dc49d14ff)) * **api:** add OAuthErrorCode type ([0c8d2c3](https://github.com/openai/openai-python/commit/0c8d2c3b44242c9139dc554896ea489b56e236b8)) * **client:** add event handler implementation for websockets ([0280d05](https: |
| `v2.31.0` | 2026-04-08 | High | ## 2.31.0 (2026-04-08)  Full Changelog: [v2.30.0...v2.31.0](https://github.com/openai/openai-python/compare/v2.30.0...v2.31.0)  ### Features  * **api:** add phase field to conversations message ([3e5834e](https://github.com/openai/openai-python/commit/3e5834efb39b24e019a29dc54d890c67d18cbb54)) * **api:** add web_search_call.results to ResponseIncludable type ([ffd8741](https://github.com/openai/openai-python/commit/ffd8741dd38609a5af0159ceb800d8ddba7925f8)) * **client:** add support for short-li |
| `v2.30.0` | 2026-03-25 | Medium | ## 2.30.0 (2026-03-25)  Full Changelog: [v2.29.0...v2.30.0](https://github.com/openai/openai-python/compare/v2.29.0...v2.30.0)  ### Features  * **api:** add keys field to Click/DoubleClick/Drag/Move/Scroll computer actions ([ee1bbed](https://github.com/openai/openai-python/commit/ee1bbeddbb38dab817557412dc106354409bb950))   ### Bug Fixes  * **api:** align SDK response types with expanded item schemas ([f3f258a](https://github.com/openai/openai-python/commit/f3f258a9d4d19db3fb0c6c35e25ad3cedbe712 |
| `v2.29.0` | 2026-03-17 | Low | ## 2.29.0 (2026-03-17)  Full Changelog: [v2.28.0...v2.29.0](https://github.com/openai/openai-python/compare/v2.28.0...v2.29.0)  ### Features  * **api:** 5.4 nano and mini model slugs ([3b45666](https://github.com/openai/openai-python/commit/3b456661f77ca3196aceb5ab3350664a63481114)) * **api:** add /v1/videos endpoint to batches create method ([c0e7a16](https://github.com/openai/openai-python/commit/c0e7a161a996854021e9eb69ea2a60ca0d08047f)) * **api:** add defer_loading field to ToolFunction ([31 |

## Citation

- HTML: https://www.freshcrate.ai/projects/openai-python
- Markdown: https://www.freshcrate.ai/projects/openai-python.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/openai-python/deps

_Generated by freshcrate.ai. Indexes github releases for AI-agent ecosystem packages._
