In this paper, an optimization process using MATLAB-SAP2000 Open Application Programming Interface (OAPI) is presented for optimum design of space frames with semi-rigid connections. A specified list including W-profiles taken from American Institute of Steel Construction (AISC) is used in the selection of suitable sections. The stress constraints as indicated in load and resistance factor design of AISC, lateral displacement constraints being the top- and inter-storey drift and geometric constraints are considered in the optimization process. Genetic algorithm method based on biological principles and harmony search algorithm method based on the processes of musical harmony are used for optimum designs. Two different space frames are solved for the cases of rigid and semi-rigid connections, separately. A computer program is coded in MATLAB for the purpose interacting with SAP2000 OAPI. Results obtained from the analyses show that type of semi-rigid connections plays a crucial role in the optimization of steel space frames and increases the optimum weight.