Postoperative sore throat (POST) is a prevalent complication after general anesthesia and targeting high-risk patients help in its prevention. This study developed and validated a machine learning model to predict POST. A total number of 834 patients who underwent general anesthesia with endotracheal intubation were included in this study. Data from a cohort of 685 patients was used for model development and validation, whilst a cohort of 149 patients served for external validation. The prediction performance of random forest (RF), neural network (NN), and XGBoost models was compared using comprehensive performance metrics. The Local Interpretable Model-agnostic Explanations (LIME) methods elucidated the best-performing model. POST incidences across training, validation, and testing cohorts were 41.7%, 38.4%, and 36.2%, respectively. Five predictors were age, sex, endotracheal tube cuff pressure, endotracheal tube insertion depth, and the time interval between extubation and the first drinking of water after extubation. After incorporating these variables, the NN model demonstrated superior generalization capabilities in predicting POST when compared to the XGBoost and RF models in external validation, achieving an area under the receiver operating characteristic curve of 0.81 (95% CI 0.74-0.89) and a precision-recall curve of 0.77 (95% CI 0.66-0.86). The model also showed good calibration and clinical usage values. The NN model outperforms the XGBoost and RF models in predicting POST, with potential applications in the healthcare industry for reducing the incidence of this common postoperative complication.