OpenAI
Official SDK- Package
openai- Install
- Install
pip install openai - Repo
- github.com/openai/openai-python
- Docs
- developers.openai.com/api/docs/libraries
From the docs
To use the OpenAI API in Python, you can use the official OpenAI SDK for Python.
Python SDKs - 19 providers checked
15 of 19 AI API providers ship an official Python SDK: OpenAI, Anthropic, Google, Mistral AI, Cohere, xAI, Groq, Together AI, OpenRouter, Amazon Bedrock, Hugging Face, Ollama, Z.ai, Alibaba Cloud Model Studio and Cerebras. Fireworks AI also ships one but labels it beta. 3 providers point to the OpenAI SDK instead.
Verified against each provider's own SDK docs and package registry pages. Status labels are the provider's own; no version numbers are recorded.
Compare every language in the provider by language grid.
Providers that ship their own Python SDK, including those they label beta.
openaipip install openaiTo use the OpenAI API in Python, you can use the official OpenAI SDK for Python.
anthropicpip install anthropicAnthropic provides three kinds of official tooling for building with the Claude API ... Client SDKs: General-purpose Messages API clients for Python, TypeScript, C#, Go, Java, PHP, and Ruby.
google-genaipip install google-genaiWhen building with the Gemini API, we recommend using the Google GenAI SDK. These are the official, production-ready libraries that we develop and maintain for the most popular languages.
mistralaipip install mistralaiWe provide official SDK clients in both Python and Typescript, you can also find third-party non-official SDKs in other languages.
coherepython -m pip install cohere --upgradeThe Cohere SDK is the primary way of accessing Cohere's models. We support SDKs in four different languages.
xai-sdkpip install xai-sdkStep 3: Install an SDK. Pick your language and install the SDK: ... pip install xai-sdk (PyPI summary: 'The official Python SDK for the xAI API')
groqpip install groqGroq provides both a Python and JavaScript/Typescript client library.
togetherpip install togetherGitHub - togethercomputer/together-py: The Official Python Client for Together's API
Fireworks AI labels this SDK alpha; it is recorded here as beta. Fireworks also says its API works with the OpenAI SDK.
fireworks-aipip install --pre fireworks-aiThe official Python SDK for the Fireworks AI API is available on GitHub and PyPI. ... The SDK is currently in alpha. Use the --pre flag when installing to get the latest version.
openrouterpip install openrouterThe Client SDKs give you a thin, type-safe layer over the OpenRouter REST API. ... | TypeScript | @openrouter/sdk | Python | openrouter | Go | go-sdk | ... All three SDKs are auto-generated from the OpenRouter OpenAPI spec
boto3 (client: boto3.client("bedrock-runtime"))python -m pip install boto3AWS software development kits (SDKs) are available for many popular programming languages. Each SDK provides an API, code examples, and documentation that make it easier for developers to build applications in their preferred language.
huggingface_hub (InferenceClient)pip install huggingface_hubFor convenience, the huggingface_hub library provides an InferenceClient that automatically handles provider selection and request routing. ... When using the Hugging Face inference clients (JavaScript or Python), you can explicitly specify a provider or let the system choose automatically.
ollamapip install ollamaUse Ollama's official libraries with either a local server or the hosted API: Python, JavaScript ... Browse community libraries.
zai-sdkpip install zai-sdkZ.AI Python SDK is the official Python development toolkit provided by Z.AI, offering Python developers convenient and efficient AI model integration solutions.
dashscopepip install -U dashscopeModel Studio provides official DashScope SDKs (Python, Java) and supports OpenAI SDKs (Python, Node.js, Java, Go) for OpenAI-compatible API calls. ... You can call models on Model Studio using the DashScope Python SDK (recommended) or the OpenAI Python SDK.
cerebras_cloud_sdkpip install --upgrade cerebras_cloud_sdkInstall the Cerebras SDK for your language of choice. (PyPI summary: 'The official Python library for the cerebras API')
For Python, these providers' docs point to the OpenAI SDK rather than a library of their own.
Not a DeepSeek SDK. For Python, DeepSeek's docs point you to the OpenAI SDK. Base URL and limits.
openaipip3 install openaiThe DeepSeek API uses an API format compatible with OpenAI/Anthropic. By modifying the configuration, you can use the OpenAI/Anthropic SDK or softwares compatible with the OpenAI/Anthropic API to access the DeepSeek API. ... # Please install OpenAI SDK first: `pip3 install openai`
Not a Azure OpenAI / Microsoft Foundry SDK. For Python, Azure OpenAI / Microsoft Foundry's docs point you to the OpenAI SDK. Base URL and limits.
openai (+ azure-identity)pip install openai azure-identityUse the OpenAI SDKs with the Azure OpenAI v1 endpoint to build model inference applications in Python, C#, JavaScript, Java, or Go.
Not a Moonshot AI SDK. For Python, Moonshot AI's docs point you to the OpenAI SDK. Base URL and limits.
openaipip install --upgrade 'openai>=1.0'OpenAI SDK 1.0.0 or later. Kimi API is compatible with the OpenAI API format, so you can call Kimi directly with the OpenAI Python or Node.js SDK.
9 more language pages, plus the full SDK reference.
Newsletter
One email per week. New models, new SDKs and the API changes that break your client, and what they mean for your stack.