Opioids are substances that act on the nervous system in a similar way to opiates such as morphine and codeine. In a medical context the term usually indicates medications that are artificially made rather than extracted from opium. Common examples include oxycodone, hydrocodone, and hydromorphone. Opioids are primarily used in medicine for the treatment of pain.