It is not known when Cui Yuan was born. He was from the "second house" (so named because one of his ancestors, Cui Kun (崔琨), was the second son of his father Cui Yi (崔懿)) branch of the famed Cui clan of Boling (博陵, roughly modern Baoding, Hebei), which claimed its ancestry from the ruling Jiang house of the Spring and Autumn period state Qi. Cui Yuan's ancestors traced their ancestry through a line of officials of Qin Dynasty, Han Dynasty, Jin Dynasty (265-420), Northern Wei, Northern Zhou, Sui Dynasty, and Tang Dynasty. Cui Yuan's granduncle Cui Gong served as a chancellor during the reign of Emperor Wuzong. Cui Yuan's grandfather Cui Yu (崔璵), who was a younger brother to Cui Gong, was a military governor (Jiedushi), while his father Cui Dan (崔澹) served as a deputy minister.
In 889, by which time Emperor Zhaozong (whose father Emperor Yizong was a cousin to Emperor Wuzong) was emperor, Cui Yuan passed the imperial examinations in the Jinshi class. Early in Emperor Zhaozong's Dashun era (890-891), Cui, while carrying the relatively low title of Yuanwailang (員外郎), became a drafter of imperial edicts. He was then made an imperial scholar (翰林學士, Hanlin Xueshi) as well as Zhongshu Sheren (中書舍人), a mid-level official at the legislative bureau of government (中書省, Zhongshu Sheng). In 896, he was made the deputy minister of census (戶部侍郎, Hubu Shilang) and was created the Baron of Boling. He thereafter was made deputy minister of defense (兵部侍郎, Bingbu Shilang) and chief imperial scholar (翰林學士承旨, Hanlin Xueshi Chengzhi).
It was said that Cui was talented, capable at writing, and was stern and focused in his expressions. The people admired his behavior and referred to him as the "Seat-Gluing Pear" (釘桌梨) — i.e., that he was like a precious delicacy such that people would not want to leave his presence.
In late 896, Emperor Zhaozong gave Cui Yuan the designation Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事), making him a chancellor. Thereafter, his other offices became Zhongshu Shilang (中書侍郎), the deputy head of the legislative bureau, and the minister of civil service affairs (吏部尚書, Libu Shangshu). In 900, he was stripped of his chancellor status and served only in those two secondary capacities. In 901, when the former chancellor Xu Yanruo, who was then the military governor of Qinghai Circuit (清海, headquartered in modern Guangzhou, Guangdong), died, Xu left a will commissioning the officer Liu Yin acting military governor but asking the imperial government to send a replacement of its own choice. Emperor Zhaozong initially commissioned Cui to be the new military governor of Qinghai. As Cui was reporting to Qinghai, he reached Jiangling, when he heard that the Lingnan region (i.e., Qinghai) was full of agrarian rebellions; he also feared that Liu, who was supported by other officers, would refuse to yield authority. He thus hesitated at advancing any further. Emperor Zhaozong thereafter recalled Cui to the imperial government.
In 904, when, at the demand of the powerful warlord Zhu Quanzhong, Emperor Zhaozong was forced to order the demotion and then the death of the leading chancellor Cui Yin, Cui Yuan and Zhu's close associate Liu Can were made chancellors to replace Cui Yin. Soon thereafter, Zhu forced Emperor Zhaozong to abandon the imperial capital Chang'an and move the capital to Luoyang. Cui Yuan accompanied Emperor Zhaozong on the journey to Luoyang.
Later in 904, Zhu assassinated Emperor Zhaozong and replaced him with his son Emperor Ai. At that time, Cui and the other chancellors Pei Shu and Dugu Sun all were senior officials who came from aristocratic families, and they despised their colleague Liu for associating with Zhu. By spring 905, Pei had offended Zhu by refusing to commission another associate of Zhu's, Zhang Tingfan (張廷範), as the minister of worship (太常卿, Taichang Qing) — trying to deflect Zhu by stating that Zhang should serve as a military governor rather than be bothered with the responsibilities of minister of worship. Liu thus took the opportunity to accuse Cui and Dugu, as well as Pei, of disrespecting Zhu. Zhu thus had all three removed from chancellor positions; in Cui's case, he was made Zuo Pushe (左僕射), one of the heads of the executive bureau (尚書省, Shangshu Sheng).
With Zhu preparing to seize the throne, Liu and another associate of Zhu's, Li Zhen, argued for a general purge of high-level imperial officials who were from aristocratic families. Zhu agreed, and initially a large number of them were demoted and exiled — in Cui's case, to be the prefect of Lai Prefecture, and then to be the census officer of Bai Prefecture (白州, in modern Yulin, Guangxi). Soon thereafter, some 30 of these officials — including Cui, Pei, Dugu, fellow former chancellors Lu Yi, Wang Pu, and other officials Zhao Chong (趙崇) and Wang Zan (王贊) — were rounded up at Baima Station (白馬驛, in modern Anyang, Henan) and ordered to commit suicide. At Li Zhen's request (as Li Zhen, who was unable to pass the imperial examinations, resented these traditional aristocrats for claiming to be free from taint), Zhu had their bodies thrown into the Yellow River (as Li Zhen put it, to taint them).