It is not known when Cui Yuanshi was born. He was from "The elder house of Boling" of the prominentCui clan of Boling, which claimed ancestry from the ruling Jiang house of the Spring and Autumn period state Qi. Cui Xuan's traceable ancestors included officials of Qin Dynasty, Han Dynasty, Jin Dynasty, Northern Wei, and Tang Dynasty. His father Cui Jing served as a secretary general of the executive bureau of government. His older brother Cui Yuanlüe was a prominent official during the reigns of Emperor Xianzong, Emperor Xianzong's son Emperor Muzong, and Emperor Muzong's sons Emperor Jingzong and Emperor Wenzong. Cui Yuanlüe was considered a potential chancellor at times, but was never chancellor. Cui Yuanlüe's son Cui Xuan, however, served as a chancellor before Cui Yuanshi did, and would again after Cui Yuanshi. Other than Cui Yuanlüe, Cui Yuanshi also had at least one older brother, Cui Yuanshou, and one younger brother, Cui Yuanru ; all of these Cui brothers known in history, including Cui Yuanshi passed the imperial examinations in the Jinshi class. Cui Yuanshi himself served on the staffs of regional governors early in his career. He was eventually himself made the governor of Hunan Circuit.
During Emperor Wuzong's reign
In 843, during the reign of Emperor Wuzong, Cui Yuanshi was made the military governor of Hezhong Circuit, as well as the mayor of its capital Hezhong Municipality. In 844, he was made the military governor of Hedong Circuit, as well as the mayor of its capital Taiyuan Municipality. In 846, he was recalled to the capital Chang'an to serve as the minister of justice.
During Emperor Xuānzong's reign
Emperor Wuzong died in 846 and was succeeded by his uncle Emperor Xuānzong. Thereafter, in 847, Cui Yuanshi was made the director of finances, and then further made Menxia Shilang, the deputy head of the examination bureau of government, as well as chancellor de facto with the designation Tong Zhongshu Menxia Pingzhangshi. In 848, Cui was removed from his chancellor position and made the minister of census, due to illness. He died thereafter, and was given posthumous honors and the posthumous name of Zhuang.