During Emperor Suzong's reign
In 755, An Lushan rebelled at Fanyang, and by summer 756, forces of his new state of Yan reached Chang'an, forcing Emperor Xuanzong to flee to Chengdu. Li Heng, however, did not follow Emperor Xuanzong to Chengdu, but instead fled to Lingwu, where he was declared emperor (as Emperor Suzong). He summoned Li Bi to Lingwu to serve as an advisor, and Li Bi did so. It was said that they spent so much together discussing the affairs of the military and the state that they often slept in the same bedroom, just like the times when Emperor Suzong was just a prince. It was said that Emperor Suzong consulted Li Bi on every matter, including military commissions. He wanted to make Li Bi Zhongshu Ling (中書令) – the head of the legislative bureau of government (中書省) and a post considered one for a chancellor – but Li Bi declined, stating, "I find it much more honored that Your Imperial Majesty treats me as a guest and a friend, than as a chancellor. Why do you want me to take an inferior position?"
Thereafter, when Emperor Suzong wanted to make his son Li Tan the Prince of Jianning, who was known for his military talent, the supreme commander of the armed forces, Li Bi pointed out that awkwardness would then come to the issue of imperial succession given that Li Tan was younger than his brother Li Chu the Prince of Guangping. Emperor Suzong agreed and gave the title of supreme commander to Li Chu instead. Li Tan, however, did not resent Li Bi for this and thanked Li Bi for his suggestion. It was said that at that time, the soldiers, whenever they saw Emperor Suzong and Li Bi surveying the troops together, the soldiers would comment: "The one who wears the yellow robe is the holy one [(i.e., emperor)]. The one who wears the white robe is the mystical one." Emperor Suzong, hearing this, told Li Bi to put on the purple robe of a high-level official, and Li Bi reluctantly agreed. Subsequently, Emperor Suzong gave him the title of imperial advisor (侍謀軍國, Shimou Junguo) as well as Li Chu's secretary general. From that point on, he and Li Chu would rotate to be on duty at the army headquarters, ready to act on the generals' reports; when Li Chu was attending to Emperor Suzong, Li Bi would be at headquarters, and when Li Bi was attending to Emperor Suzong, Li Chu would be at headquarters. Emperor Suzong also gave the keys to the makeshift palace to Li Chu and Li Bi. Whenever there were generals' requests that needed immediate action, Li Chu and Li Bi would act on them, and whenever further approval from Emperor Suzong were necessary, they would take them to the palace and submit to Emperor Suzong through a slot in the door. In fall 756, at Li Bi's suggestion, Emperor Suzong moved his headquarters from Lingwu to Pengyuan (彭原, in modern Qingyang, Gansu), to better coordinate the troops coming to his aid.
Also in fall 756, however, Li Bi and Li Tan both offended Emperor Suzong's favorite concubine Consort Zhang. Emperor Suzong had been considering creating Consort Zhang empress, but, as Li Bi advised him that it was inappropriate to do so before he had a chance to seek the approval of Emperor Xuanzong (whom he honored as Taishang Huang (retired emperor)), he decided to wait. Meanwhile, however, around this time Emperor Xuanzong sent Consort Zhang a saddle with seven kinds of jewels studded on it as a gift. Li Bi opined that in the difficult times, it would be inappropriate for her to use such a luxurious item, and therefore suggested instead that the jewels be removed and rewarded to those soldiers with accomplishments. Emperor Suzong agreed – and Li Tan publicly praised the decision, causing Consort Zhang to thereafter bear much resentment toward Li Bi and Li Tan. Meanwhile, in winter 756, after the chancellor Fang Guan failed to recapture Chang'an and suffered heavy losses, Emperor Suzong initially wanted to punish Fang, but at Li Bi's intercession, did not do so.
Meanwhile, Li Bi also suggested to Emperor Suzong his plan of destroying Yan:
That the major generals Li Guangbi and Guo Ziyi be sent to the region north of the Yellow River to engage the Yan generals Shi Siming, Zhang Zhongzhi, so that Shi and Zhang would be unable to move south.
That meanwhile, Emperor Suzong himself not attack, but continue to stay close to Chang'an, so that the Yan generals An Shouzhong (安守忠) and Tian Qianzhen (田乾真), then at Chang'an, would be unable to move east.
That Li Guangbi and Guo then launch periodic attacks against Yan troops, such that the Yan forces would be forced to constantly move and become worn out.
That in spring 757, Li Tan be sent to join Li Guangbi to capture Fanyang, and then the Tang armies could then converge toward An Lushan's capital at Luoyang and attack it.
Emperor Suzong was happy about the plan. Meanwhile, however, Consort Zhang entered into an alliance with Emperor Suzong's trusted eunuch Li Fuguo, and together the two became powerful inside the palace, purportedly carrying out much misdeeds. Li Tan considered trying to kill them, and despite Li Bi's advice to the contrary, Li Tan did not stop his planning. In 757, Consort Zhang and Li Fuguo struck first, accusing Li Tan of plotting to kill Li Chu, and Emperor Suzong, believing their accusation, forced Li Tan to commit suicide. This caused Li Chu and Li Bi to be fearful of her as well, although at Li Bi's urging, Li Chu did not himself try to kill them. Around this time, Emperor Suzong also consulted Li Bi on what his thoughts were on how to reward the generals after Yan's destruction, and Li Bi advocated that the generals be given fiefdoms so that they would want to pass them to their descendants. (Emperor Suzong initially agreed, but the plan was never actually implemented in Emperor Suzong's reign or after.)
Later in spring 757, Emperor Suzong advanced to Fengxiang (鳳翔, in modern Baoji, Shaanxi). Aid troops from Anxi Circuit (安西, headquartered in modern Aksu Prefecture, Xinjiang, as well as Xiyu states, were arriving, and Li Bi, as he had previously suggested, advocated that the troops be sent to attack Fanyang first, to root out Yan's power base, before attempts should be made to recapture Chang'an and Luoyang. This time, however, Emperor Suzong overruled him, stating that he wanted to capture Chang'an as soon as possible to welcome Emperor Xuanzong back to the capital, despite Li Bi's objections that doing so would prolong the rebellion in that the Anxi and Xiyu troops could not bear the heat and would be worn out after recapturing Chang'an and Luoyang. (As it turned out, whether it was due to Emperor Suzong's decision to overrule Li Bi or not, the rebellion would not be completely put down until 763.)
In summer 757, with major aid from Huige, Tang forces commanded by Li Chu recaptured Chang'an. Emperor Suzong entered Chang'an and sent messengers to bring Li Bi to Chang'an. Upon Li Bi's arrival in Chang'an, Emperor Suzong informed Li Bi that he had sent messengers to Emperor Xuanzong requesting that he return to Chang'an and offering the throne back to Emperor Xuanzong. Li Bi pointed out that this would cause Emperor Xuanzong to be apprehensive as to Emperor Suzong's sincerity, and as Li Bi predicted, Emperor Xuanzong initially not only declined but further requested to remain in Jiannan Circuit (劍南, headquartered in modern Chengdu). Only after Emperor Suzong, at Li Bi's suggestion, had the government officials make a joint submission to Emperor Xuanzong no longer mentioning the return of the throne, did Emperor Xuanzong agree to depart Jiannan to return to Chang'an.
Thereafter, Li Bi requested to resign his positions and return to the mountains as a hermit. Emperor Suzong was surprised and stated to Li Bi that this was time for him to be rewarded. Li Bi stated that if he stayed, he would die because people (apparently referring to Consort Zhang and Li Fuguo, although his biography in the New Book of Tang also referred to the chancellor Cui Yuan) would be jealous of him for five reasons – that he had too long of an association with Emperor Suzong; that Emperor Suzong trusted him too much; that Emperor Suzong treated him too well; that he had too much accomplishments; and that their friendship was too legendary. Emperor Suzong initially guessed that the real reason for his wanting to leave was Emperor Suzong's refusal to follow his advice on attacking Fanyang first, but Li Bi then stated that it was because of Li Tan's death. He argued to Emperor Suzong that Li Tan was innocent, and that by this point, there would surely be false accusations against Li Chu as well, and that he should not listen to them. With Li Bi insisting on resigning, Emperor Suzong allowed him to return to hermit life at Mount Heng, and had the local government there build him a hermitage and supply him with supplies due a high-level official (of the third rank). While he was at his hermitage, he got into the habit of using pine branches to make back supports, and on one occasion, when he saw one in the shape of a dragon, he sent it to Emperor Suzong as a gift.