CORS is a pain to deal with, especially when you use a language like javascript that uses the browser to do the requests (which enforces CORS).
I would look at what Bambu Studio/Orca Slicer/the App does. You could look at the web traffic (assuming none of them use cert pinning, then you will have more work to do) or you could take a look at their source code, which you can find here:
Another thing that can help is to search in all of GitHub for specific endpoints, for example Code search results · GitHub which yields a few resources that might help.