This tutorial will have three parts to it, not all of which might be applicable to you:

1. Getting an API key from OpenAI

2. Setting up an authentication proxy server

The proxy server will sit between your p5 sketch and OpenAI’s servers and add your API key to all requests. You can either run this proxy locally using node.js (outside the scope of this tutorial), or you can set it up on Glitch - which is what this tutorial is showing how to do: