PurposeAn accurate prediction of survival prognosis is beneficial to guide clinical decision-making. This prospective study aimed to develop a model to predict one-year mortality among older patients with coronary artery disease (CAD) combined with impaired glucose tolerance (IGT) or diabetes mellitus (DM) using machine learning techniques.MethodsA total of 451 patients with CAD combined with IGT and DM were finally enrolled, and those patients randomly split 70:30 into training cohort (n = 308) and validation cohort (n = 143).ResultsThe one-year mortality was 26.83%. The least absolute shrinkage and selection operator (LASSO) method and ten-fold cross-validation identified that seven characteristics were significantly associated with one-year mortality with creatine, N-terminal pro-B-type natriuretic peptide (NT-proBNP), and chronic heart failure being risk factors and hemoglobin, high density lipoprotein cholesterol, albumin, and statins being protective factors. The gradient boosting machine model outperformed other models in terms of Brier score (0.114) and area under the curve (0.836). The gradient boosting machine model also showed favorable calibration and clinical usefulness based on calibration curve and clinical decision curve. The Shapley Additive exPlanations (SHAP) found that the top three features associated with one-year mortality were NT-proBNP, albumin, and statins. The web-based application could be available athttps://starxueshu-online-application1-year-mortality-main-49cye8.streamlitapp.com/.ConclusionsThis study proposes an accurate model to stratify patients with a high risk of one-year mortality. The gradient boosting machine model demonstrates promising prediction performance. Some interventions to affect NT-proBNP and albumin levels, and statins, are beneficial to improve survival outcome among patients with CAD combined with IGT or DM.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12933-023-01854-z.