Develop with the OpenAI APIs in Python
Use GPT models from Python: generation, summarization, question answering, embeddings and fine-tuning.
- Duration
- 21 h · 3 days
- Level
- Intermediate
- Format
- On site · Remote · Blended
- Max. group size
- 12 participants
Overview
This program teaches how to integrate language models into Python applications. Participants understand how GPT models work, use the API and its Python library, develop generation, summarization and question-answering features, then explore embeddings, moderation, speech and images. The last day covers advanced prompt engineering, few-shot learning and domain adaptation.
Who this program is for
- Python developers
- Data scientists
- Teams adding generative AI features to a product
Prerequisites
- Knowledge of Python
- Notions of REST APIs
Learning objectives
- Understand how GPT models work and their limits
- Call the API from Python
- Develop text generation, summarization and question answering
- Use embeddings, moderation and other APIs
- Control costs, security and privacy
- Apply few-shot learning and domain adaptation
Detailed curriculum
6 modules · 21 h · 3 days
Understanding GPT models
- AI, machine learning and deep learning
- Types of learning
- Evolution of large language models
- Advantages, limits and parameters
- Playground and first tries
First calls from Python
- API keys and best practices
- Official Python library
- Messages and roles
- Handling errors and rate limits
- Estimating costs
Write a Python client that queries the model.
Generation features
- Text generation and editing
- Content summarization
- Question answering
- Structured outputs
- Assessing quality
Develop a document summarization tool.
Other APIs and security
- Embeddings and semantic search
- Moderation
- Speech recognition and image generation
- Data privacy
- Security of keys and calls
Advanced prompt engineering
- Few-shot learning
- Reasoning chains
- System instructions and guardrails
- Systematically evaluating prompts
- Handling drift
Improve a prompt using a test set.
Domain adaptation and project
- Preparing datasets
- Adapting the model to a domain
- Fine-tuning: when and why
- Fine-grained API parameters
- Capstone mini-project
Build a complete Python application with a model.
Tools and technologies
Teaching methods
- Alternating short lectures and hands-on work
- Live demonstrations by the trainer
- Capstone project built throughout the modules
- Group corrections and discussion of best practices
Assessment
- Hands-on exercises corrected in each module
- Mini-project completed at the end of the course
- Knowledge-check quiz
Required equipment
- A computer with an internet connection
- Python 3, a code editor and an API key (provided or personal)
Resources provided
- Course materials and repository of corrected exercises
Career outcomes
- A Python application integrating a language model
- A set of reusable patterns
- Mastery of costs and limits
Related video courses
My video courses that go with this program, to get ready for the training or to review afterwards. Free with an account.

