It is not known when Li Anqi was born. He came from a line of famed officials, as his grandfather Li Delin served as a high level official under Emperor Wen of Sui, and his father Li Baiyao served as an official of both Sui Dynasty and its successor Tang Dynasty. Li Baiyao also completed the ''Book of Northern Qi'', the official history of Northern Qi, the dynasty under which Li Delin started his career, which Li Delin started.
Li Anqi himself was said to be intelligent and articulate in his youth, and he was able to began interpreting texts when he was six years old. Late in the reign of Emperor Yang of Sui , Li Baiyao had been demoted to be the military advisor to the governor of Shi'an Prefecture , when he was intercepted by agrarian rebels near Lake Tai, and the rebels were about to put him to death, when Li Anqi wept and kneeled, asking the rebels to spare his father and to kill him instead. The rebels took pity on Li Anqi and spared them both.
Early in the reign of Emperor Taizong of Tang, Li Anqi, who had become a low level governmental official, served as the official in charge of the imperial seals and staffs. He participated in the editing of the official history of Jin Dynasty , the ''Book of Jin'', a project headed by the Fang Xuanling, and after the book was completed, he became an official at the ministry of ceremonies, serving as the deputy head of the department in charge of supplying the descendants of the imperial houses of Tang's predecessors Sui and Northern Zhou.
During Emperor Gaozong's reign
During the ''Yonghui'' era of Emperor Taizong's son and successor , Li Anqi served as a mid-level official at the legislative bureau of government , and later served as ''Huangmen Shilang'' , the deputy head of the examination bureau . As of 666, when Emperor Gaozong was offering sacrifices to heaven and earth at Mount Tai, Li Anqi was serving as the deputy minister of civil service, and Emperor Gaozong had him author the text for the monument at the altar.
It was said that Li Anqi had the ability to find talented people. Around 667, on one occasion, Emperor Gaozong rebuked his officials for not recommending talented people to be officials. Most of the officials were silent and unable to defend themselves, but Li responded:
Emperor Gaozong agreed, and he soon made Li the deputy head of the examination bureau again , and in summer 667 gave him the designation ''Tong Dong Xi Tai Sapin'' , making him a chancellor ''de facto''. However, four months later, he was no longer chancellor, as he was sent to serve as the secretary general at Jing Prefecture . He did not appear to have returned to central government service, and he was said to have died early in Emperor Gaozong's ''Xianheng'' era .