Integrating artificial intelligence (AI) into mathematics education offers opportunities to support students’ critical thinking. However, the relationships among digital learning quality, AI use, and digital literacy in shaping mathematical critical thinking remain insufficiently understood. This study examined the direct relationships of digital learning quality, AI use, and digital literacy with students’ mathematical critical thinking, as well as the moderating role of digital literacy. A quantitative explanatory-predictive design was employed involving 640 senior high school students from eight schools in Surakarta, Indonesia, comprising four public and four private schools. Data were analysed using partial least squares structural equation modelling (PLS-SEM) with SmartPLS 4. The results showed that digital learning quality (β = 0.387, p < .001), AI use (β = 0.342, p < .001), and digital literacy (β = 0.284, p < .001) were positively associated with mathematical critical thinking. Digital literacy also had significant positive moderating effects on the relationships between digital learning quality and mathematical critical thinking (β = 0.185, p < .001) and between AI use and mathematical critical thinking (β = 0.244, p < .001). The model explained 44.2% of the variance in mathematical critical thinking (R² = 0.442). These findings highlight the importance of considering digital literacy alongside the quality of digital learning environments and purposeful AI use in mathematics education. Instructional practices should integrate technology-supported learning with activities that develop mathematical reasoning, information verification, evaluation, and justification. Given the explanatory-predictive design and geographical scope, the findings indicate significant modelled relationships rather than causal effects.