How to install and configure AI features step by step

How do I install and use OpenAI instead of a self hosted AI?