Supply chain finance plays a crucial role as a financing channel for small‐ and medium‐sized enterprises (SMEs). However, issues such as financial problems and credit defaults have led to disruptions in this channel. To address credit risk control in SME financing within the field of supply chain finance, this paper focuses on a sample of 506 equipment manufacturing companies listed on the SME board of the Shenzhen Stock Exchange from 2016 to 2020. Taking into consideration, the overall risks faced by these enterprises, the study establishes seven first‐level indicators and identifies 84 candidate second‐level indicators. Partial correlation and variance analysis are then used for the first round of indicator screening, followed by the use of a BP neural network for the second round of selection. As a result, a system of 26 indicators for supply chain financial risk is constructed. The XGBoost model is employed to evaluate the constructed risk index system, while SVM and random forest models are used as comparison models. Bayesian optimization is utilized for parameter tuning of the three models. Empirical results demonstrate that the BO‐XGBoost model reduces prediction errors in comparison to the control models. Furthermore, statistical tests reveal that the predicted values of the BO‐XGBoost model significantly differ from those of the other control models. Compared to other individual models, the BO‐XGBoost model exhibits increased accuracy in credit risk prediction and a significant discriminative effect. These findings highlight the effectiveness of constructing an efficient risk indicator system and utilizing Bayesian optimization for parameter tuning in XGBoost to better differentiate between risky and normal enterprises, thereby minimizing default losses. The research results underscore the advantages of employing Bayesian optimization in XGBoost, which can be applied in credit default prediction for SMEs and serves as a valuable tool in financial risk management and control.