Long prompt completion request returning each token as a separate API response, along with 524 error

Hi,

I am using Wized to retrieve data from the OpenAI API within Webflow. I am running into an issue where if I have a long prompt (~80 words) or set max_tokens to > ~500, then the API is returning what seems like one token at a time. This is happening regardless of whether I use /chat/completions or /completions, and for both GPT-3.5 and GPT-4 models.

Does this seem like a Wized issue or is this standard behaviour?

Here is an image of what is being returned if that helps - as you can see it is returning HTML which I asked for, but not in the conventional way (see example underneath for a shorter prompt working properly):

image

Any help appreciated!

This is what a correct output should return:

image

Is the stream parameter set to false in the API request?