Selective export and retrieval of proteins between the endoplasmic reticulum (ER) and Golgi apparatus is indispensable for eukaryotic cell function. An essential step in the retrieval of ER luminal proteins from the Golgi is the pH-dependent recognition of a carboxyl-terminal Lys-Asp-Glu-Leu (KDEL) signal by the KDEL receptor. Here, we present crystal structures of the chicken KDEL receptor in the apo ER state, KDEL-bound Golgi state, and in complex with an antagonistic synthetic nanobody (sybody). These structures show a transporter-like architecture that undergoes conformational changes upon KDEL binding and reveal a pH-dependent interaction network crucial for recognition of the carboxyl terminus of the KDEL signal. Complementary in vitro binding and in vivo cell localization data explain how these features create a pH-dependent retrieval system in the secretory pathway.