Objective To analyze the influencing factors of anxiety in adults with obstructive sleep apnea (OSA), establish and validate a nomgram model for predicting the risk of anxiety in OSA patients. Methods From January 2022 to December 2024, a total of 461 OSA patients diagnosed at the Second People's Hospital of Yibin were collected and divided into a model group (345 cases) and an internal validation group (116 cases) according to a 3:1 ratio. The model group was divided into an anxiety group and a non-anxiety group based on the Hamilton Anxiety Scale (HAMA) score of 7. Univariate and multivariate analyses were conducted to identify the influencing factors of anxiety in OSA patients. A nomogram model was established by R language. The discriminant, calibration, and net benefit of the model were validated by area under receiver operating characteristic curve (AUC), Hosmer-Lemeshow test, and decision curve analysis (DCA). ResultsThe incidence of anxiety in 461 OSA patients was 45.77%, and there were statistically significant differences (P<0.05) in 17 factors including body mass index (BMI) between the anxiety group and the non-anxiety group. Lasso regression identified 8 meaningful variables, and logistic regression found that BMI, the Epworth sleeping scale (ESS) score, medical insurance type, pooled hypertension and 5-hydroxytryptamine (5-HT) were influencing factors of anxiety in the OSA patients, with OR values (95%CI) of 0.673 (0.562-0.806), 0.801 (0.754-0.851), 0.377 (0.237-0.597), 0.363 (0.150-0.874) and 0.708 (0.575-0.872), respectively. The nomogram model based on these indicators has good discrimination, calibration, and net profit in the model group, internal validation group, and external validation group, with AUC of 0.893, 0.894, and 0.792, sensitivity of 0.902, 0.857 and 0.832, specificity of 0.830, 0.809 and 0.795, respectively. The maximum offsets of the model group, internal validation group, and external validation group were 0.049, 0.026, and 0.025, respectively (P=0.917, 0.881, and 0.823, respectively). The model group had a higher net profit at the low to medium risk threshold (0-0.7). Conclusions BMI, ESS, medical insurance type, pooled hypertension, OSA-18 score, 5-HT concentration are the influencing factors of anxiety in OSA patients. The nomogram model based on these indicators can effectively predict the risk of anxiety in OSA patients.