The OpenAi docs give CURL examples which can be followed using regular REST API calls using URLConnection.
The docs for URLConnection is located here: URLConnection — Xojo documentation
Some more information on using URLConnection for REST API calls:
https://documentation.xojo.com/topics/communication/internet/accessing_web_services.html
This is a pretty good video on YouTube by @Paul_Lefebvre