Inflammatory pain is the most common type of pain encountered in clinical practice; however, the currently available treatments are limited by insufficient efficacy and side effects. Therefore, new methods to relieve inflammatory pain targeting new mechanisms are urgently needed. Preclinical investigations have shown that CR (calorie restriction) exerts analgesic effects in neuropathic and cancer pain; however, the effect of CR on chronic inflammatory pain remains unknown. During calorie restriction, autophagy, a lysosome-dependent degradation process, can be activated to support cell survival. In the present study, we investigated the analgesic effects of CR on complete Freund's adjuvant (CFA)-induced inflammatory pain. The accumulation of LC3-II and p62 showed impaired autophagic flux in the ipsilateral spinal cord of mice with CFA-induced inflammatory pain. CR alleviated mechanical allodynia and thermal hyperalgesia and reduced paw edema and pro-inflammatory factors following CFA administration. CR exerted an analgesic effect by restoring autophagic flux in the spinal cord. Regarding the mechanisms underlying the analgesic effects of CR, β-hydroxybutyric acid (BHB) was studied. CR increased BHB levels in the ipsilateral spinal cord. Furthermore, exogenous BHB administration exerted an analgesic effect by restoring autophagic flux in the spinal cords of CFA-induced inflammatory pain mice. Taken together, these results illustrated that CR relieved inflammatory pain by restoring autophagic flux in the spinal cord, while BHB controlled the benefits of CR, suggesting that CR or BHB might be a promising treatment for inflammatory pain.