Solar Panels

Installed solar panels in 2023, but financed them and will pay off the loan in 2024. In what tax year to we claim the tax credit?