'gpt-3.5-turbo', // Adjust model as necessary 'messages' => [["role" => "user", "content" => $message]], ]); $response = wp_remote_post($this->api_url, [ 'headers' => [ 'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $api_key, ], 'body' => $body, 'data_format' => 'body', ]); if (is_wp_error($response)) { return false; // Handle error appropriately } $body = wp_remote_retrieve_body($response); return json_decode($body, true); } }