With the emergence of the digital economy, digital technologies—such as artificial intelligence (AI)—have provided new possibilities for the green development of enterprises. Green total factor productivity is a key indicator of green sustainable development. While traditional total factor productivity does not consider the constraints of natural resources and the environment, green total factor productivity remedies this deficiency by incorporating environmental protection indicators, such as pollutant emissions, into the accounting system. To further clarify the relationship between AI technology and corporate green total factor productivity, this study uses a two-way fixed effects model to examine the impact of AI technology on the corporate green total factor productivity of A-share listed companies in China from 2013 to 2020 while examining how corporate slack resources affect the relationship between the two. The results show that the AI application positively contributes to the green total factor productivity of enterprises. Meanwhile, firms’ absorbed, unabsorbed, and potential slack resources all positively moderate the positive impact of AI technology on firms’ green total factor productivity. This study offers a theoretical basis for a comprehensive understanding of digital technology and enterprises’ green development. It also contributes practical insights for the government to formulate relevant policies and for enterprises to use digital technology to attain green and sustainable development.