OpenAI Python Library
Official Python SDK to call OpenAI APIs including GPT models and embeddings.
Model SDKs PyPI
Used in agent projects
244
1.9% of 12,697 public repos built with AI coding agents
Rank in model sdks
#4 of 15
by use in those projects
Downloads
75.1M
PyPI, last 7 days, openai
GitHub stars
31.8K
last push Oct 9, 2026
How OpenAI Python Library is used
OpenAI Python Library is a dependency in 244 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (1.9%), #4 of 15 in model sdks. The most used alternative there is OpenAI. Projects that use it most often also use python-dotenv (77.9%), Pydantic (58.6%), Uvicorn (52.9%). It is more common in projects set up for Roo Code (7.1%) than for OpenAI Codex (1.3%).
Often used with OpenAI Python Library
| python-dotenv | 77.9% of OpenAI Python Library projects · 11.9× more than average |
|---|---|
| Pydantic | 58.6% of OpenAI Python Library projects · 11.5× more than average |
| Uvicorn | 52.9% of OpenAI Python Library projects · 12.3× more than average |
| FastAPI | 50.0% of OpenAI Python Library projects · 11.8× more than average |
| Requests | 50.0% of OpenAI Python Library projects · 9.4× more than average |
| NumPy | 47.5% of OpenAI Python Library projects · 12.4× more than average |
| pandas | 35.2% of OpenAI Python Library projects · 11.7× more than average |
| PyYAML | 32.0% of OpenAI Python Library projects · 10.5× more than average |
By coding agent
| GitHub Copilot | 3.6% of projects set up for it |
|---|---|
| Claude Code | 2.7% of projects set up for it |
| Cursor | 3.1% of projects set up for it |
| Gemini CLI | 2.7% of projects set up for it |
| Devin Desktop | 4.0% of projects set up for it |
| Roo Code | 7.1% of projects set up for it |
| OpenAI Codex | 1.3% of projects set up for it |
| OpenCode | 1.6% of projects set up for it |
Share of public repos configured for each agent that list OpenAI Python Library as a dependency.
Install
| Package | pip install openai |
|---|---|
| Main stacks | Python (234), Next.js (7), Other (2), React Native / Expo (1) |
| Example projects | dramaclaw/dramaclaw, Josh-XT/AGiXT, learntocloud/learn-to-cloud-app, prompt-security/ps-fuzz, sidetrip-ai/ici-core |
Alternatives to OpenAI Python Library
| Tool | Used in agent projects | Downloads / wk | GitHub stars | License |
|---|---|---|---|---|
| OpenAI npm Official TypeScript SDK for accessing OpenAI APIs including GPT and embeddings. |
362 (2.9%) | 43.2M | 11.2K | Apache-2.0 |
| AI SDK npm Vercel's unified SDK for building AI apps with OpenAI, Anthropic, Google and more. |
328 (2.6%) | 29.8M | 27.2K | Apache-2.0 |
| Google Generative AI npm Official SDK for Google Gemini API to build AI-powered applications. |
258 (2.0%) | 25.3M | 1,686 | Apache-2.0 |
| Anthropic SDK npm Official TypeScript SDK for calling Claude API and building agent applications. |
211 (1.7%) | 46.5M | 2,136 | MIT |
| Anthropic Python SDK pypi Official Python library for calling Claude via the Anthropic API. |
115 (0.9%) | 40.9M | 3,954 | MIT |
| Google GenAI Python SDK pypi Official Python SDK for Google's generative AI models including Gemini. |
111 (0.9%) | 34.1M | 4,013 | — |
| Hugging Face Hub pypi Python client library for downloading and publishing models and datasets on Hugging Face. |
59 (0.5%) | 60M | 3,974 | Apache-2.0 |
| Transformers.js npm Run Hugging Face transformer models directly in browser without servers. |
34 (0.3%) | 3.9M | 16.3K | Apache-2.0 |