Renewable energy is a safe and limitless energy source that can be utilized for heating, cooling, and other purposes. Wind energy is one of the most important renewable energy sources. Power fluctuation of wind turbines occurs due to variation of wind velocity. A wind cube is used to decrease power fluctuation and increase the wind turbine’s power. The optimum design for a wind cube is the main contribution of this work. The decisive design parameters used to optimize the wind cube are its inner and outer radius, the roughness factor, and the height of the wind turbine hub. A Gradient-Based Optimizer (GBO) is used as a new metaheuristic algorithm in this problem. The objective function of this research includes two parts: the first part is to minimize the probability of generated energy loss, and the second is to minimize the cost of the wind turbine and wind cube. The Gradient-Based Optimizer (GBO) is applied to optimize the variables of two wind turbine types and the design of the wind cube. The metrological data of the Red Sea governorate of Egypt is used as a case study for this analysis. Based on the results, the optimum design of a wind cube is achieved, and an improvement in energy produced from the wind turbine with a wind cube will be compared with energy generated without a wind cube. The energy generated from a wind turbine with the optimized cube is more than 20 times that of a wind turbine without a wind cube for all cases studied.