Most insurers, including Medicare and Medicaid, will cover a medically necessary detoxification admission, primarily for alcohol and sedative-hypnotics (benzodiazepines, barbiturates). Some will also cover brief inpatient detoxification admission for opiates.
There are few inpatient detoxification programs for cocaine, as the withdrawal is not typically medically hazardous. Most insurers will also not reimburse for inpatient cocaine detoxification treatment.
As for longer inpatient rehabilitation stays, there is a tremendous range of what each private insurance plan will cover. Additionally, many private rehabilitation centers insist on payment up front, although they will assist in helping people submit necessary paperwork to their insurance company.