Murine models suggest that opioids alter the gut microbiota, which may impact opioid tolerance and psychopathology. We examined how gut microbiota characteristics related to use of opioid agonists and antagonists among people receiving outpatient addiction treatment. Patients (n = 46) collected stool samples and were grouped by use of opioid agonists (heroin, prescription opioids), antagonists (naltrexone), agonist-antagonist combinations (buprenorphine-naloxone), or neither agonists nor antagonists within the month before enrollment. We sequenced the V4 region of the 16S rRNA gene using Illumina MiSeq to examine how alpha diversity, enterotypes, and relative abundance of bacterial genera varied by opioid agonist and antagonist exposures. Compared to 31 participants who used neither agonists nor antagonists, 5 participants who used opioid agonists (without antagonists) had lower microbiota diversity, Bacteroides enterotypes, and lower relative abundance of Roseburia, a butyrate producing genus, and Bilophila, a bile acid metabolizing genus. There were no differences in gut microbiota features between those using agonist + antagonists (n = 4), antagonists only (n = 6), and neither agonists nor antagonists. Similar to murine morphine exposure models, opioid agonist use was associated with lower microbiota diversity. Lower abundance of Roseburia and Bilophila may relate to the gut inflammation/permeability and dysregulated bile acid metabolism observed in opioid-exposed mice.