Steel pipe racks are among the most critical structures in various industries, including oil and petrochemical sectors. They are used for transporting fluids, gases, and chemicals. Given the extensive application of these structures in the oil and gas industry, their optimisation is of paramount importance. This research aims to reduce the construction costs of steel pipe racks via practical weight optimisation using the Grey Wolf Optimiser (GWO) and Whale Optimisation Algorithm (WOA) metaheuristic algorithms, as well as comparing their responses. In this study, the aforementioned algorithms are developed automatically through MATLAB, and by interfacing with ETABS, enable the optimal design of steel pipe racks while adhering to design code requirements. Leveraging metaheuristic algorithms and complying with design code requirements, this research seeks to provide a practical solution for the safe and optimised design of steel pipe rack structures, thereby reducing construction costs in the oil and gas industry. The proposed framework is evaluated on two steel pipe racks, incorporating key design considerations. The results demonstrate that both GWO and WOA metaheuristic optimisation methods can serve as effective tools for engineers in achieving cost-efficient designs.