How to Access OpenAI API?

I have seen some example of how Open AI has been embedded into Playcanvas.
I was wondering if anyone was able to give some guidance on how this would be achievable.

I am looking to enbale chat function where input text from user in Playcanvas is sent to OpenAI and response is returned to text box in PlayCanvas

I was also looking to use Microsoft Azure to host OpenAI but again at a loss as to how to implement.

Please advice. Many thanks in advance

This is a good place to start:

https://platform.openai.com/docs/quickstart?context=node

You need to set that up on the infra of your choice (AWS, Azure, GCP, etc).

Then, you’d send requests to that server from your PlayCanvas app.

Thanks will look into this!
much appreciated