Fentanyl exhibits interindividual variability in its dose requirement due to various nongenetic and genetic factors such as single nucleotide polymorphisms (SNPs). This study aims to develop and cross-validate robust predictive models for postoperative fentanyl analgesic requirement and other related outcomes in patients undergoing major breast surgery. Data regarding genotypes of 10 candidate SNPs, cold pain test (CPT) scores, pupillary response to fentanyl (PRF), and other common clinical characteristics were recorded from 257 patients undergoing major breast surgery. Predictive models for 24-hour fentanyl requirement, 24-hour pain scores, and time for first analgesic (TFA) in the postoperative period were developed using 4 different algorithms: generalised linear regression model, linear support vector machine learning (SVM-Linear), random forest (RF), and Bayesian regularised neural network. The variant genotype of OPRM1 (rs1799971) and higher CPT scores were associated with higher 24-hour postoperative fentanyl consumption, whereas higher PRF and history of hypertension were associated with lower fentanyl requirement. The variant allele of COMT (rs4680) and higher CPT scores were associated with 24-hour postoperative pain scores. The variant genotype of CTSG (rs2070697), higher intraoperative fentanyl use, and higher CPT scores were associated with significantly lower TFA. The predictive models for 24-hour postoperative fentanyl requirement, pain scores, and TFA had R-squared values of 0.313 (SVM-Linear), 0.434 (SVM-Linear), and 0.532 (RF), respectively. We have developed and cross-validated predictive models for 24-hour postoperative fentanyl requirement, 24-hour postoperative pain scores, and TFA with satisfactory performance characteristics and incorporated them in a novel web application.