Ja'far bin Ma'bad (may Allah have mercy on him), the nephew of Humayd bin Abd al-Rahman al-Himyari (may Allah have mercy on him), narrates: I went with Humayd (may Allah have mercy on him) to Sayyiduna Anas (may Allah be pleased with him), and he said: "When the people pledged allegiance to the Messenger of Allah (peace and blessings be upon him), or (he said) when we pledged allegiance to the Messenger of Allah (peace and blessings be upon him), he (peace and blessings be upon him) would prompt us (with these words), or he would say to us: 'In what I am able.'"
Affan (may Allah have mercy on him) narrated it from Shu'bah (may Allah have mercy on him).
Related hadith on this topic