ObjectiveThis study aimed to investigate the predictive value of a clinical nomogram model based on serum YKL-40 for major adverse cardiovascular events (MACE) during hospitalization in patients with acute ST-segment elevation myocardial infarction (STEMI).MethodsIn this study, 295 STEMI patients from October 2020 to March 2023 in the Second People’s Hospital of Hefei were randomly divided into a training group (n = 206) and a validation group (n = 89). Machine learning random forest model was used to select important variables and multivariate logistic regression was included to analyze the influencing factors of in-hospital MACE in STEMI patients; a nomogram model was constructed and the discrimination, calibration, and clinical effectiveness of the model were verified.ResultsAccording to the results of random forest and multivariate analysis, we identified serum YKL-40, albumin, blood glucose, hemoglobin, LVEF, and uric acid as independent predictors of in-hospital MACE in STEMI patients. Using the above parameters to establish a nomogram, the model C-index was 0.843 (95% CI: 0.79–0.897) in the training group; the model C-index was 0.863 (95% CI: 0.789–0.936) in the validation group, with good predictive power; the AUC (0.843) in the training group was greater than the TIMI risk score (0.648), p < 0.05; and the AUC (0.863) in the validation group was greater than the TIMI risk score (0.795). The calibration curve showed good predictive values and observed values of the nomogram; the DCA results showed that the graph had a high clinical application value.ConclusionIn conclusion, we constructed and validated a nomogram based on serum YKL-40 to predict the risk of in-hospital MACE in STEMI patients. This model can provide a scientific reference for predicting the occurrence of in-hospital MACE and improving the prognosis of STEMI patients.