The main aim of sizing of civil engineering structures is to minimize costs while satisfying all design requirements. The fact that the sizing is affected by bearing capacity and the bearing capacity is affected by the dimensions of the retaining wall makes it difficult to solve the sizing problem with classical methods. In this study, an optimum design has been tried to be obtained for the cantilever retaining walls with various heights and different surrounding soil conditions. The Symbiotic Organisms Search (SOS) optimization algorithm was used to optimize 1512 different scenarios, and the results were presented in tables and graphics. It has been observed that increasing both the internal friction angle of foundation soil and the internal friction angle of backfill reduces the cost of the wall. However, the effect of the foundation soil internal friction angle on the wall cost is more important, especially in poor ground conditions. In addition, critical wall heights were determined, where costs increase significantly depending on the bearing capacity.