Install
pip install openai
$
The official, type-annotated Python client for the OpenAI REST API, auto-generated from OpenAI's OpenAPI spec and working with any Python 3.9+ app. It covers the Responses API, Chat Completions, the WebSocket Realtime API, vision, file uploads, fine-tuning, and webhook verification, with both synchronous and asynchronous clients. Use it as the foundation for any Python integration with OpenAI models; it adds automatic retries, typed Pydantic responses, and cloud workload-identity auth.