The purpose of this study is to conduct a pilot trial of IV ketamine + treatment as usual (TAU) vs. midazolam (an active placebo) + TAU to estimate sample size for a full-scale RCT examining these treatments for decreasing suicidal ideation among depressed inpatients with major depressive disorder and bipolar depression.