The rapid repurposing of antivirals is particularly pressing during pandemics. However, rapid assays for assessing candidate drugs typically involve in vitro screens and cell lines that do not recapitulate human physiology at the tissue and organ levels. Here we show that a microfluidic bronchial-airway-on-a-chip lined by highly differentiated human bronchial-airway epithelium and pulmonary endothelium can model viral infection, strain-dependent virulence, cytokine production and the recruitment of circulating immune cells. In airway chips infected with influenza A, the co-administration of nafamostat with oseltamivir doubled the treatment-time window for oseltamivir. In chips infected with pseudotyped severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), clinically relevant doses of the antimalarial drug amodiaquine inhibited infection but clinical doses of hydroxychloroquine and other antiviral drugs that inhibit the entry of pseudotyped SARS-CoV-2 in cell lines under static conditions did not. We also show that amodiaquine showed substantial prophylactic and therapeutic activities in hamsters challenged with native SARS-CoV-2. The human airway-on-a-chip may accelerate the identification of therapeutics and prophylactics with repurposing potential.