The Messenger of Allah ﷺ said that Allah said, "I am as My servant expects Me to be."
وقال رسول الله ﷺ قال الله عز وجل أنا عند ظن عبدي بي
This is sahih as well, and it is in the standalone Sahifah, number 65. I did not find it in the Sahihayn by this route, but it is part of a hadith that has already appeared as 7416, narrated by Amash from Abu Salih, from Abu Hurairah.Bukhari likewise narrated it (1:325–328 Fath), and Muslim (2:306–307), both by way of Amash, as we explained in the previous narration.