This study aimed to explore potential risk factors associated with chronic pain after total knee arthroplasty (TKA) and to establish the risk prediction model of chronic postoperative pain (CPSP). This study retrospectively analyzed the clinical data of 160 patients who underwent TKA in our hospital between January 2021 and January 2024. Relevant data such as the baseline characteristics, past medical history, CPSP condition, and pain numerical rating scale (NRS) were retrieved from the medical information system. Logistic regression analysis was performed on the risk factors affecting the postoperative CPSP of the patients. The identified risk factors were incorporated to develop a risk-prediction model. Among the 160 patients, 67 (41.88%) had CPSP at or around the operation incision. The NRS pain score was significantly higher in the CPSP group than in the non-CPSP group during exercise preoperative and 3 months post-operation. Furthermore, the CPSP group had a higher NRS score than the non-CPSP group at rest 3 months after the procedure (p < 0.05). We observed that the preoperative NRS score, preoperative hospital for special surgery (HSS) score, postoperative functional training, and postoperative adverse events were the independent factors influencing the occurrence of CPSP after TKA (p < 0.05). Additionally, there was a significant positive correlation between preoperative NRS score, postoperative adverse events, and CPSP pain severity, and a significant negative correlation between preoperative HSS score, postoperative functional training, and CPSP pain severity (p < 0.05). The receiver operating characteristic (ROC) curve had excellent calibration and prediction capabilities for the predictive model of CPSP after TKA, with the area under the curve (AUC) of 0.868 (95% CI: 0.811-0.925). In this study, the predictive model of CPSP risk for patients after TKA surgery was initially constructed, which can help medical staff predict the risk of CPSP in patients after surgery individually, thereby preventing the occurrence of CPSP.