HTTP status for Chat completion

How do I get HTTP status code with the latest version of OpenAI library 4.4.0 in NodeJS. In the older version, I could use response.status to get the HTTP status to check whether there was an error. How do I check that the response to my API call is correct. For example, I am using NodeJS as follows:

    const request = {
        model: model,
        messages: [
                role: 'user',
                content: prompt,

    // Call the OpenAI API
    const response = await;

With the previous version I could just do:

    if (response.status === 200) {
            message: response.choices[0].message.content,

But now with 4.4.0 response doesnā€™t have a status field.

1 Like