Estimating the costs of blasting operations is an important parameter in open-pit mining. Blasting and rock fragmentation depend on two groups of variables. The first group consists of mass properties, which are uncontrollable, and the second one is the drill-and-blast design parameters, which can be controlled and optimized. The design parameters include burden, spacing, hole length, hole diameter, sub-drilling, charge weight, charge length, stemming length, and charge density. Blasting costs vary depending on the size of these parameters. Moreover, blasting brings about some undesirable results such as air overpressure, fly rock, back-break, and ground vibration. This paper proposes a mathematical model for estimating the costs of blasting operations in the Baghak gypsum mine. The cost of blasting operations in the objective function is divided into three parts: drilling costs, costs of blasting system, and costs of blasting labours. The decision variables used to minimize the costs include burden, spacing, hole diameter, stemming length, charge density, and charge weight. Constraints of the model include the boundary and operational limitations. Air overpressure in the mine is also anticipated as one of the model constraints. The non-linear model obtained with consideration of constraints is optimized by simulated annealing (SA). After optimizing the model by SA, the best values for the decision variables are determined. The value obtained for the cost was obtained to be equal to 2259 $ per 7700 tons for the desired block, which is less than the blasting costs in the Baghak gypsum mine.