openai/openai-python

The official Python library for the OpenAI API

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 7 minutes ago
Added to GitGenius on September 13th, 2026
Created on October 25th, 2020
Open Issues & Pull Requests: 388 (+0)
GitHub issues: Enabled
Number of forks: 5,189
Total Stargazers: 31,618 (+0)
Total Subscribers: 404 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

The openai-python library is the official Python client for the OpenAI API.

The library provides convenient access to OpenAI's REST API from Python 3.10 and later applications. It is generated from OpenAI's OpenAPI specification and includes complete type definitions for all request parameters and response fields. The library offers both synchronous and asynchronous clients built on HTTPX2, allowing developers to choose the execution model that fits their application architecture.

Developers should use this library if they are building Python applications that need to call OpenAI's APIs. It suits any project from simple scripts to production services. The library supports multiple authentication methods beyond standard API keys, including workload identity authentication for cloud environments like Kubernetes, Azure, and Google Cloud Platform, as well as X.509 certificate-based mutual TLS authentication for environments requiring certificate-based federation. The README recommends storing API keys in environment variables via python-dotenv rather than in source code.

The project maintains active development with regular updates to keep pace with OpenAI's API changes. The library is regenerated from the OpenAPI specification, ensuring that new endpoints and parameters are reflected promptly. The codebase demonstrates attention to security practices, particularly in how it handles authentication credentials and supports modern cloud-native authentication patterns. The project provides comprehensive documentation through both the README and a detailed api.md file, alongside the official platform documentation.