In recent years, the rapid development of artificial intelligence (AI) has sparked academic interest in its economic and environmental impacts. Against the backdrop of global warming, this study evaluates the impact of AI on energy transition and constructs an evaluation index system to measure the level of the digital economy, analyzing its role in AI and energy transition. The study first finds that AI positively affects energy transition, whereby as AI advances, the level of energy transition improves. Second, the digital economy plays a positive role in reinforcing the impact of AI on the energy transition. Finally, high-income and middle- and low-income countries exhibit different performances in the energy transition promoted by AI, with a more pronounced impact in resource-dependent countries. These findings offer specific insights for policymakers aiming to advance the energy transition, address regional energy disparities, and achieve low-carbon development.