There is no way to use it in the frontend securely. Communicating with OpenAI will have to happen on the backend and to prevent anyone from abusing your API, it will have to be protected by authentication.
Yeah sounds like OP is advertising an MVP that you can run in localhost with the sole purpose of proving a concept. There's no way this is going to any wise-man production project
Connect to a backend api that does the requests to OpenAi. Setup CORS to prevent embedding on other sites. And remember your api is still completely unauthenticated so add rate limiting and a block list to limit abuse.
"Note: Don't expose your API key in public-facing apps. We will be adding a solution for securely using your API key soon."
I have ideas how to implement this, but I would like to get some feedback first.