Curiously, they already have something like that already.
If you take a course on deeplearning.ai (I tried ChatGPT Prompt Engineering for Developers), you can run a notebook that accesses OpenAI API.
If you look closely, you'll notice they authenticate not with an API key but with a temporary JWT token that gets handed to you when you start a lesson.
I don't know how they do it, but it's certaily possible.