BACKGROUNDCommunity-acquired pneumonia (CAP) increases mortality risk in older patients, often complicated by delirium. Key risk factors include malnutrition and glucose metabolism disorders. This study examines the Stress Hyperglycemia Ratio (SHR) as a predictive marker for delirium in older CAP patients and its role in clinical risk management.METHODSIn this retrospective study, we analyzed patients aged 65 and older diagnosed with CAP at the Second People's Hospital of Lianyungang. Delirium was evaluated using the Confusion Assessment Method (CAM) based on DSM-5 criteria. We assessed clinical data, including nutritional status, SHR, and Interleukin-6 (IL-6) levels. Nutritional status was measured using the Mini Nutritional Assessment Short Form (MNA-SF). Statistical analyses including logistic regression, Receiver Operating Characteristic (ROC) analysis, and mediation analyses were used to ascertain the predictive value of SHR and its interaction with other delirium risk factors.RESULTSThe average age of the cohort was 84.20 ± 5.15 years, with a delirium incidence of 19.68 % and a 28-day mortality rate of 11.16 %. Both SHR and IL-6 were significant risk factors for delirium, while higher MNA-SF scores were protective. An SHR of 1.12 or greater indicated an elevated risk of delirium. Combined assessments of SHR, IL-6, and MNA-SF enhanced predictive accuracy, achieving an AUC of 0.723. SHR and IL-6 independently and synergistically influenced the relationship between nutritional status and delirium onset.CONCLUSIONSHR is a crucial risk factor for delirium in older CAP patients, interacting with nutritional and inflammatory markers. Integrating SHR with nutritional and inflammatory assessments can enhance early risk identification and improve clinical outcomes for this vulnerable group.