The search for safe and efficient chronic pain treatments is dampened by the lack of reliable models that faithfully reproduce current pharmacological treatments for chronic spontaneous pain in humans. Preclinical models often assess the antinociceptive efficacy of non-contingent pharmacological treatments evaluated in the short-term. Here, we provide a protocol of contingent operant self-medication in mice, which allows the estimation of spontaneous pain relief and drug abuse liability in models of persistent pain. This paradigm requires preliminary habituation and animal handling, followed by training of mice in operant conditioning boxes, to allow subsequent analgesic drug self-administration. After the initial acquisition of food-maintained operant behavior, a chronic pain sensitization is induced. Posterior intravenous jugular catheterization and coupling of operant conditioning boxes to perfusion pumps allow quantification of operant responding for intravenous drug self-administration. All mice show an initial operant drug self-administration behavior associated with the previous food-maintained operant training. This initial operant responding is extinguished after administration of ineffective treatments, but continues when the compounds have analgesic efficacy or intrinsic reinforcing properties. The identification of a significant drug self-administration selectively expressed in mice exposed to the chronic pain condition is indicative of analgesic drug effects, whereas persistent self-administration in control mice is indicative of abuse liability. The present protocol provides the behavioral and surgical procedures needed to assess spontaneous pain relief and potential for abuse of pharmacological treatments, through contingent analgesic self-medication in mice. Graphic abstract: Animals are subjected to a 5-day food self-administration protocol with a fixed ratio of reinforcement of 1 (FR1, 1 interaction with the active nose-poke causes the release of 1 reinforcer/infusion), to acquire the operant behavior. After this training, mice are subjected to the chronic pain or sham procedure, and four days later an intravenous (i.v.) catheterization is performed, to allow self-administration with the selected compound or its vehicle. Three days after the catheterization, animals start the drug/vehicle self-administration protocol at FR1. The patency of the catheter is evaluated with the thiopental test after the last self-administration session. Adapted from Bura (2018).