The opioid epidemic is a crisis that has plagued the United States (US) for decades. One of the central issues of the epidemic is inequitable access to treatment for opioid use disorder (OUD), which puts certain populations at a higher risk of opioid overdose. This issue has not yet been systematically addressed using computational methods. In this work, we use real-world data and optimization to formulate the problem of finding the optimal locations of opioid treatment facilities and the optimal treatment budget distribution in each US state. To capture the dynamics of the changing opioid epidemic, we develop a state-level differential equation-based epidemiological model. We fit this model to current opioid epidemic data using neural ordinary differential equations, a useful framework that allows us to embed differential equations into a neural network layer. We then integrate this epidemiological model for each state into a corresponding mixed-integer optimization problem (MIP) for treatment facility location and resource allocation. We seek to minimize opioid overdose deaths and the number of people with OUD. Our MIPs also target socioeconomic equitability by considering social vulnerability (from the CDC’s Social Vulnerability Index) and opioid prescribing rates in each county. Our MIPs' proposed solutions on average decrease the number of people with OUD by 5.76%, increase the number of people in treatment by 21.60%, and decrease the number of opioid-related deaths by 0.52% after 2 years. This work lays the mathematical and computational foundations to assist governments, policymakers, and health professionals in combating the opioid epidemic.