OpenAI Python SDK
The official Python library for the OpenAI API. Build powerful AI applications with type-safe, async-ready client libraries.
Quick Start
Get up and running with the OpenAI Python SDK in minutes
Set your API key
Explore the SDK
Discover the powerful features of the OpenAI Python SDK
Responses API
Generate text with the modern Responses API
Chat Completions
Create conversational AI experiences
Audio
Convert text to speech and transcribe audio
Images
Generate and edit images with AI
Embeddings
Create vector representations of text
Assistants
Build stateful AI assistants with threads
Core Features
Everything you need to build production-ready AI applications
Type Safety
Full type definitions for all request and response fields
Async Support
Native async/await support for high-performance applications
Streaming
Stream responses in real-time for better UX
Error Handling
Comprehensive error types and retry logic
Azure OpenAI
Seamless integration with Azure OpenAI Service
Helpers
Utility functions and event handlers
Ready to build with OpenAI?
Start building powerful AI applications with the OpenAI Python SDK today.
Get Started