This paper presents a test for exogeneity of explanatory variables in a nonparametric instrumental variables (IV) model whose structural function is identified through a conditional quantile restriction. Quantile regression models are increasingly important in applied econometrics. As with mean-regression models, an erroneous assumption that the explanatory variables in a quantile regression model are exogenous can lead to highly misleading results. In addition, a test of exogeneity based on an incorrectly specified parametric model can produce misleading results. This paper presents a test of exogeneity that does not assume the structural function belongs to a known finite-dimensional parametric family and does not require estimation of th...