Pei Yaoqing was born in 681, during the reign of . His family traced its ancestry to a line of officials of Han Dynasty, Jin Dynasty , Western Liang, Southern Qi, Northern Wei, Sui Dynasty, and Tang Dynasty. Pei Yaoqing's grandfather Pei Shen served as a county magistrate during Tang, and his father Pei Shouzhen served as a prefectural prefect.
Pei Yaoqing was said to be intelligent well-learned even in childhood, being able to read complex text when he was only a few years old. He later passed a special imperial examination for boys, and in his youth became an assistant secretary at the archival bureau . He later served as the communications for Emperor Gaozong's son the Prince of Xiang. Li Dan respected him, and made him and his colleague Wei Liqi consultants. After Li Dan, a former emperor, returned to the throne in 712 , he made Pei ''Guozi Zhubu'' , the secretary general at the imperial university.
During Emperor Xuanzong's reign
Early in the ''Kaiyuan'' era of Emperor Ruizong's son , Pei Yaoqing was made the magistrate of Chang'an County -- one of the two counties making up the Tang capital Chang'an. At that time, Chang'an County put governmental funds in trust with rich households to have them manage the funds for the government, leading to much trouble for both government and the people. Pei ended the practice and retrieved the funds from the rich households, reducing both corruption and burden on these households. He served as magistrate of Chang'an County for two years, and it was said that he drew a balance between strictness and laxity. When he left that office, the people missed him greatly.
In 725, Pei became the prefect of Ji Prefecture . That year, Emperor Xuanzong offered sacrifices to heaven and earth at Mount Tai, and as he went through the various prefectures, the prefectural prefects were rushing to offer him tributes -- but Emperor Xuanzong was impressed by three prefects -- Wang Qiu , Cui Mian , and Pei, who offered no luxury items -- and in Pei's case, what he offered was several hundred suggestions, all of which were aiming toward correcting Emperor Xuanzong's behavior. Emperor Xuanzong was particularly impressed with one of the suggestions, which stated, "If you cause great harm to the people, then you cannot say that the realm is peaceful." Emperor Xuanzong promoted the three of them -- in Pei's case, to be the prefect of the more important Ding Prefecture . At the time that his promotion was announced, he was overseeing a project to repair the Yellow River levees. Instead of departing immediately for Ding Prefecture, he delayed his departure to make sure that the levees would be complete. He later successively served as the prefect of Xuan and Ji Prefectures, before being recalled to Chang'an to serve as the deputy minister of census .
In 732, Emperor Xuanzong commissioned his second cousin Li Hui the Prince of Xin'an to command an army against Khitan and Xi tribes which would not submit to Tang suzerainty, with Pei as Li Hui's deputy. After Li Hui scored a major victory over both the Khitan and the Xi, Emperor Xuanzong ordered Pei to tour the Xi tribes that were submissive and which had participated in the campaign, to award a large amount of silk to them. Pei, realizing that such a journey would be filled with danger as other tribes might become aware and might attack, proceeded quickly on the trip and divided his train into several groups, awarding the silk quickly and then returning to Tang territory. Indeed, hearing about Pei's tour, Eastern Tujue and Shiwei forces launched a raid against him, but by the time that they arrived, Pei had already returned to Tang territory. In winter 732, he was made the mayor of Jingzhao Municipality , which encompassed Chang'an.
In fall 733, there was much raining in the Guanzhong region , causing flooding and rise in food prices. Emperor Xuanzong considered going to the eastern capital Luoyang, to decrease the need to requisition food supplies, and he summoned Pei to discuss with him. Pei suggested revising the food shipment scheme at that time to reduce the need for such journeys. Pei's proposal included several points:
* At that time, most of the food supply was coming from south of the Yangtze River and were shipped by ships from the region, which were unfamiliar with the waters in the Yellow River region, the journeys were often slow, often causing thefts or embezzlement. Under Pei's proposal, a large food storage would be built at Hulao, where Bian River joined Yellow River, and the ships from the Yangtze region would offload their supplies at Hulao.
* The food supply would then be shipped from Hulao to Luoyang on either the Yellow River or the Luo River .
* One large food storage would be built on each side of Sanmenxia. The food supplies intended for Chang'an would be shipped from Luoyang to Sanmenxia and stored there.
* A road would be built from Sanmenxia upstream to the Wei River, allowing food to be shipped on land when the water flow was unsuitable for shipping on water.
* Once the food supply had been shipped to the Wei River either on land or on water, the food could then be shipped easily to Chang'an.
Emperor Xuanzong agreed with the proposal. Later that year, when he removed the s Xiao Song and Han Xiu from their chancellor positions, he made Pei and Zhang Jiuling new chancellors to succeed them. Specifically, Pei was made ''Huangmen Shilang'' , the deputy head of the examination bureau of government with the chancellor ''de facto'' designation ''Tong Zhongshu Menxia Pingzhangshi'' . He was also made the director of food supply shipments .
In 734, Zhang proposed that private citizens be allowed to mint money. Pei opposed, pointing out that the quality of the coins would be greatly reduced. Emperor Xuanzong, with opposition also from , decided not to allow private minting. Later that year, Pei was made ''Shizhong'' , the head of the examination bureau and a post considered one for a chancellor. Pursuant to Pei's proposal, a shipping station was built at the point where the Yellow River and the Bian River joined, with two large food storages -- Heyin Storage to the east and Boyai Storage to the west. At Sanmenxia, Jijin Storage was built to the east, and Yan Storage was built to the west. A road 18 '''' long was built from Sanmenxia to the Wei River. With Pei's plan implemented, the government received considerably savings during the next three years, and Pei's subordinates suggested that he submitted the surpluses to the emperor as a tribute. Pei stated, "This is money saved for the government. How can I use it to ingratiate the emperor?" Instead, he saved the money for future transportation improvements. However, at that time, an incident occurred where there were strange apparitions appearing in the Luoyang Palace, and Emperor Xuanzong did not want to stay at Luoyang. On or right before November 9, 736, he summoned the chancellors to ask them whether he could depart for Chang'an immediately. Pei and Zhang, pointing out the fact that it was harvest season and that the imperial train would interfere with harvest, requested a one-month delay. After Pei and Zhang exited, however, Li Linfu remained personally and stated his agreement with the departure, arguing that the farmers could be compensated by relieving their taxes. Emperor Xuanzong was pleased and immediately departed for Chang'an.
* Emperor Xuanzong was, then, impressed with Niu Xianke, the military governor of Shuofang Circuit , wanted to make him the minister of defense. Zhang, who pointed out that Niu was not well-learned and had started from the ranks of low-level administrators -- contrary to the Tang tradition of going through the imperial examinations -- opposed, and then further opposed the creation of a title. Eventually, despite Zhang's opposition, Emperor Xuanzong, with concurrence from Li LInfu, created Niu the Duke of Longxi.
* Li LInfu was associating with Emperor Xuanzong's favorite concubine and trying to have Emperor Xuanzong make her son Li Mao the Prince of Shou crown prince to replace Emperor Xuanzong's then-crown prince Li Ying, who had long lost Emperor Xuanzong's favor. With Zhang strenuously opposing such a move, Li Ying remained in his position.
* The deputy minister Xiao Jiong , whom Li Linfu recommended, was demoted on the suggestion of Zhang and Zhang's friend Yan Tingzhi , who further offended Li Linfu by refusing to meet with him. Soon thereafter, there was an incident where Wang Yunyan , the husband of Yan's ex-wife, was accused of corruption. Yan tried to intercede on Wang's behalf, and this was discovered.
Li Linfu thus made accusations to Emperor Xuanzong that Zhang and Pei were engaging in factionalism. Around the new year 737, Emperor Xuanzong removed Pei and Zhang from their chancellor posts, making them ''Chengxiang'' -- the heads of the executive bureau instead. Niu was made chancellor to replace them, serving with Li Linfu. At the same time, Pei was created the Marquess of Zhaocheng.
Later in 737, there was an incident in which the Yang Jun the prefect of Yi Prefecture , was accused of corruption and received a death sentence. Emperor Xuanzong commuted the sentence to caning for 60 times and exile to Gu Prefecture . Pei submitted a petition, pointing out that while caning instead of death was grace already, public caning nevertheless was undignified for someone who had been an honored official. Emperor Xuanzong agreed and commuted the caning as well.
In 740, Emperor Xuanzong, impressed at the military accomplishments of the general Gai Jiayun , the military governor of Hexi and Longyou Circuits, summoned him to the capital to reward him and commissioned him to plan an attack on Tufan. Gai, happy about the imperial favor, lingered in Chang'an and did not immediately depart. Pei submitted a petition, pointing out that while Gai was brave, he was becoming arrogant and unattentive in light of imperial favors. He suggested that Gai's commission be cancelled, or, in the least, that Emperor Xuanzong order Gai to immediately return to his command. Emperor Xuanzong did the latter. Later, as Pei predicted, Gai was unable to prevail over Tufan.
Pei continued to serve as ''Pushe'' for the next several years. He died in 743 and was given posthumous honors.