Introduction It is possible to predict immune-related adverse events (irAEs) in the treatment of immune checkpoint inhibitors (ICIs) based on clinical and hematological parameters. Nevertheless, the specific parameters which can predict irAEs are still in the exploration. The purpose of this retrospective study was to develop a predictive model for irAEs in non-small cell lung cancer (NSCLC) patients in the treatment of ICIs. Methods Researchers enrolled NSCLC patients treated with at least 1 type of ICIs at Harbin Medical University Cancer Hospital between January 30, 2019 and December 31, 2021. Baseline parameters including demographic, clinicopathology, treatment information, and peripheral blood markers were selected retrospectively. Type, onset time, grade, and treatment of irAEs were also assessed. By analyzing the risk factors for irAEs, an irAEs prediction model was established using univariate and multivariate logistic regression. Results In a total of 484 patients, 81 patients experienced 112 irAEs in which thyroid dysfunction was the most common irAE ( n = 38, 33.9%) and ICI pneumonitis was the most serious irAE ( n = 6, 33.3%). Finally, a prediction model based on lines and combination therapy of ICIs, ECOG performance status, neutrophils/lymphocytes ratio (NLR), platelet (PLT), and lymphocyte (LYM) was established. Multivariate logistic regression analysis showed that 2 or ≥3 lines of immunotherapy, ICIs combination therapy, and ECOG PS 1–2 were independent risk factors for irAEs. Baseline LYM was positively associated with irAEs (OR = 2.599, P = 0.048) while baseline NLR and PLT were negatively associated with irAEs (OR = 0.392, P = 0.047; OR = 0.992, P = 0.035, respectively). The model showed great prediction performance with the AUC value of 0.851 and 0.779 in the training cohort and validation cohort, respectively. Conclusion Our study identified the risk factors related to irAEs occurrence and constructed and assessed the predictive model of irAEs in patients with NSCLC treated by ICIs using clinical and hematological parameters, thus guiding clinicians to select precisely the population receiving immunotherapy and develop individualized treatment therapy.