Yes, you may have pain medications as a therapy but you will need to see a pain management doctor specifically. Then he or she will decide how best to treat your pain, which may or may not include pain medication.
The other posters are incorrect, this is not a community to get people off of pain meds. Many, if not most of us here, use opioid medications as treatments to manage our pain, to improve our lives. However, this is becoming increasingly difficult due to the number of people abusing the drugs.