The Messenger of Allah (ﷺ) had himself cupped when he was fasting.

Abu Dawud said: Wuhaib b. Khalid narrated a similar tradition from Ayyub through a different chain of narrators. Ja'far b. Rabi'ah and Hisham, that is, Ibn Hassan, narrated a similar tradition from 'Ikrimah on the authority of Ibn 'Abbas.
Sunan Abi Dawud Book 14, Hadith 60