Personalized treatment selection is crucial for cancer patients due to the high variability in drug response. While actionable mutations can increasingly inform treatment decisions, most therapies still rely on population-based approaches. Here, we introduce neural interaction explainable AI (NeurixAI), an explainable and highly scalable deep learning framework that models drug–gene interactions and identifies transcriptomic patterns linked with drug response. Trained on data from 546 646 drug perturbation experiments involving 1135 drugs and molecular profiles from 476 tumors, NeurixAI accurately predicted treatment responses for 272 targeted and 30 chemotherapeutic drugs in unseen tumor samples (Spearman’s rho >0.2), maintaining high performance on an external validation set. Additionally, NeurixAI identified the anticancer potential of 160 repurposed non-cancer drugs. Using explainable artificial intelligence (xAI), our framework uncovered key genes influencing drug response at the individual tumor level and revealed both known and novel mechanisms of drug resistance. These findings demonstrate the potential of integrating transcriptomics with xAI to optimize cancer treatment, enable drug repurposing, and identify new therapeutic targets.