An opioid is any agent that binds to opioid receptors, found principally in the central nervous system and gastrointestinal tract.
There are four broad classes of opioids: endogenous opioid peptides, produced in the body; opium alkaloids, such as morphine (the prototypical opioid) and codeine; semi-synthetic opioids such as heroin and oxycodone; and fully synthetic opioids such as pethidine and methadone that have structures unrelated to the opium alkaloids.
Opioids have long been used to treat acute pain (such as post-operative pain).
They have also found to be invaluable in palliative care to alleviate the severe, chronic, disabling pain of terminal conditions such as cancer.
Very high doses are often required in palliation to improve the patients' terminal quality-of-life.