diff --git a/src/OpenAi.php b/src/OpenAi.php index fe5fa7c..3eac621 100644 --- a/src/OpenAi.php +++ b/src/OpenAi.php @@ -513,11 +513,12 @@ private function sendRequest(string $url, string $method, array $opts = []) $curl = curl_init(); curl_setopt_array($curl, $curl_info); - $response = curl_exec($curl); - curl_close($curl); + $response = curl_exec($curl); $info = curl_getinfo($curl); $this->curlInfo = $info; + + curl_close($curl); return $response; }