This work aims to investigate the minimum dosage required to achieve optimal removal of carbon, nitrogen, and phosphorus in the Chemical Enhanced Primary Treatment (CEPT) process using magnetic coagulation technology. A response surface methodology was adopted to generate multiple regression models to optimize the dosages of three types of coagulation, i.e., polyaluminum chloride (PAC), polyacrylamide (PAM), and magnetic medium Fe3O4 particles (MP), based on the removal rates of chemical oxygen demand (COD), ammonia nitrogen (NH3-N), and total phosphorus (TP). The results showed that the regression models could predict results well with actual engineering results. Compared to the traditional coagulation process, the synergistic enhancement of PAC+PAM+MP in the CEPT process significantly improved the treatment effects. Based on the COD removal rates, PAC performed better than MP, followed by PAM; likewise, for the NH3-N and TP removal rates, PAC outperformed PAM, followed by MP. The optimized PAC, PAM, and MP dosages were 135.87, 1.51, and 108.36mg/L, respectively, reaching 92.27% COD, 71.98% NH3-N, and 91.33% TP removal rates with less than 5% errors compared to the experimental verification results. These optimization models offer a practical and cost-saving reference for enhancing the primary treatment effect on carbon, nitrogen, and phosphorus removal using PAC+PAM+MP.