Opioids target the μ-opioid receptor (MOR) to produce unrivaled pain management but their addictive properties can lead to severe abuse. We developed a whole animal behavioral platform for unbiased discovery of genes influencing opioid responsiveness. Using forward genetics in we identified a conserved orphan receptor, GPR139, with anti-opioid activity. GPR139 is coexpressed with MOR in opioid-sensitive brain circuits, binds to MOR and inhibits signaling to G proteins. Deletion of GPR139 in mice enhanced opioid-induced inhibition of neuronal firing to modulate morphine-induced analgesia, reward, and withdrawal. Thus, GPR139 could be a useful target for increasing opioid safety. These results also demonstrate the potential of as a scalable platform for genetic discovery of GPCR signaling principles.