openai
#2 of 54 by Downloads / month among PyPI packages
The official Python library for the openai API
About
The OpenAI Python library provides convenient access to the OpenAI REST API from any Python 3.9+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by httpx.
It is generated from our OpenAPI specification with Stainless.
The REST API documentation can be found on platform.openai.com. The full API of this library can be found in api.md.
The full API of this library can be found in api.md.
The primary API for interacting with OpenAI models is the Responses API. You can generate text from the model with the code below.
The previous standard (supported indefinitely) for generating text…
Excerpted from pypi.org/project/openai/
Latest metrics
| Downloads / month | 370.3M | 2026-07-16 |
|---|---|---|
| Downloads / week | 85.8M | 2026-07-16 |
| Downloads / day | 13.8M | 2026-07-16 |