Background. Diesel engines play a crucial role in ensuring human comfort and well-being across residential, commercial, transportation, and emergency response sectors because of their reliability and versatility. However, identifying alternative fuels remains a significant challenge. Objective. This study aims to develop a comprehensive mathematical model using Response Surface Methodology (RSM) to optimize the performance of Compression Ignition (CI) engines utilizing different types of plastic pyrolysis oil. Methods. Through systematic data collection and analysis, this study examines the importance of design parameters, specifically injection pressure, compression ratio, engine load, and type of plastic pyrolysis oil, which are important for specific fuel consumption. A prediction model was developed to identify the complex correlations between these factors and the fuel use. Results. The developed model serves as an effective tool for optimizing the CI engine performance under diverse operational conditions. Experimental validation involved testing diesel engines with conventional diesel fuel and various plastic pyrolysis oils, followed by optimization using RSM to achieve optimal engine performance. The engine load was identified as the most significant parameter affecting the specific fuel consumption, followed by the fuel type, injection pressure, and compression ratio. The high R-squared (99.35%) and adjusted R-squared (98.02%) values indicate that the proposed model effectively fits the experimental data. Conclusion. The RSM-based model effectively optimizes CI engine performance under varied operational conditions. It significantly reduces the time and effort required to optimize engine design variables, thus enhancing engine performance and sustainability.