[1] After Li Keyong resubmitted to Tang authority and was made the military governor (Jiedushi) of Yanmen Circuit (t 雁門道 or 鴈門道, s 雁门道, Yànmén Dào) around present-day Datong in 882,[3] he made Gai Yu a base supervisor as well as the prefect of Lan Prefecture (嵐州, in modern Lüliang, Shanxi).
After Li Keyong was later made the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi), Gai continued as a base supervisor.
[1] In 885, after a dispute between the powerful eunuch Tian Lingzi and Li Keyong's ally Wang Chongrong the military governor of Huguo Circuit (護國, headquartered in modern Yuncheng, Shanxi) erupted into an armed conflict, Wang Chongrong's and Li Keyong's forces defeated the forces of Tian and his allies Zhu Mei the military governor of Jingnan Circuit (靜難, headquartered in modern Xianyang, Shaanxi) and Li Changfu the military governor of Fengxiang Circuit (鳳翔, headquartered in modern Baoji, Shaanxi).
Fearful of Wang Chongrong's and Li Keyong's approaching forces, Tian took then-reigning Emperor Xizong and fled to Xingyuan (興元, in modern Hanzhong, Shaanxi).
As part of this, Gai was made the governor (觀察使, Guanchashi) of Rong District (容管, in modern Yulin, Guangxi), but did not actually report there.
[7] In 897, Emperor Zhaozong upgraded Rong District to Ningyuan Circuit (寧遠) and made Gai its military governor.
In his will, he advised Li Keyong to reduce construction projects, lower taxes and levies, and seek out wise counselors.