Abu Usaid reported that the Messenger of Allah (ﷺ) said
When any one of you enters the mosque, he should say:" O Allah! open for me the doors of Thy mercy" ; and when he steps out he should say: 'O Allah! I beg of Thee Thy Grace." (Imam Muslim said: I heard Yahya saying: I transcribed this hadith from the compilation of Sulaiman b. Bilal.)
A hadith like this has been narrated from the Messenger of Allah (ﷺ) by Abu Usaid.