I am working on a ChatGPT plugin which will operate and respond with voice, and I sort of need yoour advice on the back-end part of the text-to-speech portion.
Specifically for text-to-speech I am using php/cURL as the backend which works fine if the text that needs to be modified is relatively short, otherwise you wait for too long because cURL is synchronous and need to finish the download from the server before continouing.
Now, openAI API comes with a streaming option but I do not how to use it correctly because I would need to make async PHP calls to the openAI server which rather tricky.
What would be your advice dealing with these async calls:
a) use a PHP library, and if yes which one?
b) should I make these calls outside wordpress like perhaps integrating with node-js?
c) something else?

Hire a developer.
Ask ChatGTP. 
Seriously though, you may want to cross-post in r/PHPhelp or r/phpHelpWithProjects, the question isn’t necessarily WordPress-specific, even though you are making a plugin.
I googled “Async PHP” and found many answers about how to connect that way.
[https://www.geeksforgeeks.org/how-to-make-async-functions-in-php/](https://www.geeksforgeeks.org/how-to-make-async-functions-in-php/)
This article suggests that you must use reactPHP or AMP.