In this research, a fast and inexpensive method has been developed for measuring azathioprine in the biological samples based on air-assisted liquid–liquid microextraction followed by high-performance liquid chromatography. The effects of six factors on the extraction recovery were analyzed and were optimized by Plackett–Burman design and Box–Behnken design. According to the Plackett–Burman design results, the volume of the extraction solvent and the rate and time of centrifuge did not have significant effects on the extraction of azathioprine. The optimized conditions of extraction were achieved at the aspiration/dispersion cycles of 23, pH of 2 for the sample, and 10% (W/V) of sodium chloride. Under these conditions, the extraction recoveries in urine and plasma samples were obtained 85 and 96, respectively. The detection limit of azathioprine was 3 ng mL−1 in plasma and 3.2 ng mL−1 in urine. Also, this method makes it possible to measure this drug in urine and plasma in the linear range of 10–1000 ng mL−1. The RSDs values were in the ranges of 4.6–6.2% in three measurements. This method was fast, easy, and environmentally friendly, which used low volumes of organic solvents and has been applied successfully for measuring azathioprine in plasma and urine.