Li Kui was born in 713, at the start of the reign of . He was from a prominent clan that, by Li Kui's time, was domiciled in Zheng Prefecture but which traced its ancestry to a line of prominent officials of Northern Wei, who in turn traced their ancestry to Li Fan , a son of Li Gao, the founder of the Sixteen Kingdoms state Western Liang. After Northern Wei, Li Kui's ancestors served as officials of Sui Dynasty and Tang Dynasty. Li Kui was said to be intelligent, dextrous, and studious in his youth, and he was capable in writing.
During Emperor Xuanzong's reign
Toward the end of Emperor Xuanzong's ''Kaiyuan'' era , Li Kui passed the imperial examinations and was made the sheriff of Chenliu County . After he submitted his writing to Emperor Xuanzong, Emperor Xuanzong, apparently impressed, issued an edict allowing him to work at the legislative bureau of government on a trial basis. He was subsequently made ''You Shiyi'' , a junior official at the legislative bureau, and then successively served in the higher offices of ''You Bujue'' and ''Zhuzuo Lang'' at the legislative bureau, and then as ''Zhi Zongzi Biaosu'' , the official in charge of receiving and acting on submissions from members of the imperial clan at the ministry of imperial clan affairs . Later, he was promoted to be ''Sixun Yuanwai Lang'' , a junior official at the ministry of civil service affairs , and then the higher office of ''Kaogong Langzhong'' at the ministry of civil service affairs, in charge of evaluating the officials' performance. He was also involved in drafting edicts for Emperor Xuanzong. After the general An Lushan rebelled in 755 and forced Emperor Xuanzong to flee to Jiannan Circuit , Li Kui accompanied Emperor Xuanzong to Jiannan and was made ''Zhongshu Sheren'' , a mid-level official at the legislative bureau.
During Emperor Suzong's reign
Emperor Xuanzong's son and crown prince , however, did not follow him to Chengdu and instead fled to Lingwu, where he was declared emperor , an act that Emperor Xuanzong recognized when he heard the news. After Emperor Suzong recaptured and returned to Chang'an in 757, his wife became a dominating figure at court. She wanted her son Li Zhao the Prince of Xing, who was only several years old at that point, to be made crown prince. Emperor Suzong, however, was instead considering his oldest son the Prince of Cheng, who had contributed much to his campaigns to recapture Chang'an and the eastern capital Luoyang. Emperor Suzong consulted Li Kui and stated to him, "The Prince of Cheng is the oldest and had accomplished much. I want to create him crown prince. What do you think, sir?" Li Kui got up and bowed to Emperor Suzong, stating: "This is great blessing to the state. I am uncontrollably happy." Li Kui's comments affirmed Emperor Suzong's thoughts, and he created Li Chu crown prince in summer 758. In spring 759, when the officials who wanted to flatter Empress Zhang proposed that she be given a special honorific epithet of ''Yisheng'' . When Emperor Suzong consulted Li Kui on whether this was appropriate, Li Kui opposed, pointing out that the only prior instance when such an epithet was given to a living empress was to , the powerful and corrupt wife of Emperor Suzong's granduncle . After a lunar eclipse — which indicated divine displeasure with the empress — occurred around the same time, Emperor Suzong tabled the proposal.
By this point, Li Kui also had the additional office of deputy minister of rites . He was displeased with how the officials in charge of the imperial examinations at the time were making their testing questions test highly obscure facts, and he believed that this led to the selection of examinees who were not necessarily talented or capable in writing. He therefore, at the examinations, made the Confucian classics, histories, and qieyun references available to the examinees for them to look through the books during examination. He was much praised for this reform. It was also said that Li Kui was handsome in appearance and capable in rhetoric. Emperor Suzong once told him, "You, sir, are the highest grade in your clan's prominence, in your appearance, and in your writing.
Also in spring 759, Emperor Suzong, as a part of his reorganization of his chancellors, removed Miao Jinqing and Wang Yu from their chancellor posts and replaced them with Li Kui, Lü Yin, , and Diwu Qi. In Li Kui's case, he was given the post of ''Zhongshu Shilang'' , the deputy head of the legislative bureau, which was not itself a chancellor post, but given the additional ''de facto'' chancellor designation of ''Tong Zhongshu Menxia Pingzhangshi'' , making him a chancellor. He was also put in charge of editing the imperial history. At that time, there were much banditry within the city of Chang'an itself, and the powerful eunuch Li Fuguo wanted to commission several hundred soldiers from part of the imperial guard corps, the Yulin Army , to patrol the streets at night. Li Kui opposed this, pointing out that the Yulin Army and another part of the imperial guards corps, the Jinwu Guards , which were already responsible for patrolling the streets, served as counterweights to each other, and allowing the Yulin Army to patrol the streets throw the balance out of whack. Emperor Suzong agreed and tabled Li Fuguo's proposal. Nevertheless, it was also said that Li Kui did not dare to offend Li Fuguo, and despite the fact that Li Kui's clan was prominent, he bowed to Li Fuguo whenever he saw Li Fuguo, and referred to Li Fuguo as "Father Five" .
As chancellor, it was said that Li Kui was capable and decisive, but that he was also grasping onto fame and fortune, drawing criticism for doing so. He was also criticized for the fact that his brother Li Jie was also capable, but during Li Kui's term as chancellor, was stuck at a position that lacked actual power with Li Kui doing nothing about it. Meanwhile, Lü, who was removed from his chancellor position in 760, was sent out to be the military governor of Jingnan Circuit and was gaining a good reputation at the position. Li Kui, who did not get along with Lü while both were chancellor, was concerned that Lü might return to the capital to be chancellor again, submitted an accusation that Lü, who had recently had proposed having eight prefectures added to his circuit, was overly ambitious; Li Kui also sent officials to Lü's circuit to try to find faults with Lü. When Lü reported this to Emperor Suzong, Emperor Suzong, displeased, demoted Li Kui to be the secretary general of Yuan Prefecture .
During Emperor Daizong's reign
Several years later — therefore, therefore likely under the reign of Li Chu , as Emperor Daizong — Li Kui was slightly promoted, to be the prefect of She Prefecture . However, he would soon be trapped by an action from his past. While he was chancellor, Miao Jinqing had once recommended Yuan Zai for promotion. Li Kui, whose own clan was prominent and who looked down on those with humble origins — which was the case with Yuan Zai — refused, and stated to Miao:
This caused Yuan to have much resentment toward Li Kui. As Yuan became a powerful chancellor during Emperor Daizong's reign, he gave Li Kui an honorable post with little power or salary — acting ''Mishu Jian'' , the head of the archival bureau — and then ordered that Li Kui be sent to the region between the Yangtze River and the Huai River, on the excuse that Li Kui was ill and needed to tend to his illness. It was said that because the position lacked salaries and Li Kui lacked savings, his large household became so poor that members even had to beg for food. Li Kui moved from prefecture to prefecture, as he would move whenever the prefect would dishonor him. Only after Yuan was executed in 777 was Li Kui again given a substantive position — the prefect of Mu Prefecture . He later returned to Chang'an to serve as the principal of the imperial university and minister of rites .
During Emperor Dezong's reign
Emperor Daizong died in 779 and was succeeded by his son . Li Kui continued to serve as minister of rites, but the powerful chancellor Lu Qi was jealous of his reputation and seniority. In 783, after the Tufan emissary Qujiazan arrived in Chang'an to negotiate a border realignment treaty with Tang and after the treaty was completed, at Lu's instigation, Emperor Dezong made Li Kui emissary to Tufan to escort Qujiazan back to Tufan. Li Kui, then 70, stated to Emperor Dezong, "I do not fear going that far a distance, but I am afraid that I would die on the way and not complete my task." Emperor Dezong, who was saddened by the remarks, told Lu, "Li Kui is too old." Lu responded, "An emissary to a far-away foreign state needs to have a good reputation. Further, if Li Kui, who is this old, is sent as an emissary, then in the future, no official younger than Li Kui would dare to refuse such a task." When Li Kui got to Tufan, its king Trisong Detsen asked, "I heard that there is a Li Kui who is the most able of officials in Tang. Are you that person, lord?" Li Kui was afraid that this meant that Trisong Detsen intended to detain him, and therefore responded, "''That'' Li Kui would never be willing to come here." On his way of returning from Tufan in 784, he died at Feng Prefecture . He was buried with honor and given the posthumous name ''Gong'' .