Cameron James Pettit, 23, who lives in the Hollywood Hills, is expected to appear in court later on Wednesday, federal prosecutors said in a statement.
26-year-old Miller was found dead by his assistant at his San Fernando Valley home on 7 September, 2018.
A Drug Enforcement Agency affidavit claims that Miller asked Pettit for oxycodone and other drugs, but on 5 September, 2018, Pettit allegedly gave Miller counterfeit oxycodone pills laced with the powerful opioid fentanyl.
A post-mortem examination found that Miller died from an accidental overdose, via a combination of fentanyl, cocaine and alcohol.
Authorities found drugs they claim were from Pettit in Miller’s home, and evidence that Miller had allegedly crushed and sniffed oxycodone provided by Pettit.
Pettit has only been charged with providing the drugs, however, and not with having a direct role in Miller’s death.
According to the affidavit, after reports of Miller’s death circulated, Pettit allegedly sent an Instagram message to a friend saying, “Most likely I will die in jail”.
Investigators say they also obtained text messages between Miller and Pettit before the sale, in which Miller proclaims his love for oxycodone, or “percs” for the brand name Percocet, and also asks for “bars” of Xanax and a “ball” of cocaine.
Enjoy unlimited access to 70 million ad-free songs and podcasts with Amazon Music Sign up now for a 30-day free trialSign up
“When can u get em?” Miller asks, according to a transcript of the exchange contained in court filings.
“Probably in an hour or 2. They are 30 ea,” Pettit replies.
“Any chance I can get 10 of those, 10 bars and a ball?” Miller asks.
“Yeah for sure,” Pettit replies.
Miller, a Pittsburgh native whose work brought him wide respect in the hip-hop community, was in a two-year relationship with Ariana Grande that ended earlier in 2018.
He was one of a number of artists whose death has been linked in recent years to a national wave of opioid abuse and overdoses. Prince died in 2016 when he took counterfeit pills laced with fentanyl that looked like a generic version of the painkiller Vicodin.
Matthew Roberts, guitarist for the band 3 Doors Down, also died of an overdose in 2016, and had fentanyl and hydrocodone in his system.
Additional reporting by agencies