Born in (modern-day Leiyang, Hunan), Cai arrived at the imperial court in (modern-day Luoyang, Henan) by 75, where he served as a chamberlain for Emperor Ming, and then a imperial messenger () for Emperor Zhang. To assist Lady Dou in securing her adopted son as designated heir, he interrogated Consort Song and her sister, who then killed themselves. When Emperor He ascended the throne in 88, Dou awarded Cai with two positions; first—the highest position for eunuch of the time—a political counselor () to the emperor, and soon after the additional post as a "Prefect of the Palace Workshop" (), where Cai oversaw the production of instruments and weapons for imperial use.