Background: Treating chronic, uncontrolled, cancer pain with subcutaneous ketamine in patients unresponsive to opioids and co-analgesics remains controversial, especially in light of recent evidence demonstrating ketamine does not have net clinical benefit in this setting. Aim: To evaluate the cost-effectiveness of subcutaneous ketamine versus placebo in this patient population. Design and setting: A within-trial cost-effectiveness analysis of the Australian Palliative Care Clinical Studies Collaborative’s randomised, double-blind, placebo-controlled trial of ketamine was conducted from a healthcare provider perspective. Mean costs and outcomes were estimated from participant-level data over 5 days including positive response, health-related quality of life (HrQOL) measured with the Functional Assessment of Chronic Illness Therapy–Palliative Care (FACIT-Pal), ketamine costs, medication usage and in-patient stays. Results: There was no statistically significant difference in responder rates, but higher toxicity and worse HrQOL for ketamine participants (mean change −3.10 (standard error (SE) 1.76), ketamine n = 93; 4.53 (SE 1.38), placebo n = 92). Estimated total mean costs were AU$706 higher per ketamine participant (AU$6608) compared with placebo (AU$5902), attributable to the cost of higher in-patient costs as well as costs of ketamine administration. The results were robust to sensitivity analyses accounting for different medication use costing methods and removal of cost outliers. Conclusion: The findings suggest subcutaneous ketamine in conjunction with opioids and standard adjuvant therapy is neither an effective nor cost-effective treatment for refractory pain in advanced cancer patients.