Background: Studies have proven that amino acid metabolism (AAM) plays an important role in ankylosing spondylitis (AS). Therefore, this study identified key AAM-related genes (AAMRGs) for the diagnosis and prediction of AS. Methods: Firstly, the differentially expressed genes (DEGs) were identified between AS and normal groups in the GSE25101 and GSE73754 datasets downloaded from the Gene Expression Omnibus (GEO) database, and they were intersected to get common DEGs (Co-DEGs). Weighted Gene Co-expression Network Analysis (WGCNA) was used to identify AS and AAM score-related genes (AS-AAMSRGs). Then, AAM related DEGs (AAMR DEGs) were acquired by intersection of Co-DEGs and AS-AAMSRGs. Moreover, the least absolute shrinkage and selection operator (LASSO) was implemented on AAMR DEGs to identify diagnostic genes, and Gene Set Enrichment Analysis (GSEA) was used to explore the functional pathways of diagnostic genes. By screening differential immune cells, the correlation between differential immune cells and diagnostic genes was further analyzed. Finally, miRNA-mRNA networks were constructed and drug prediction analysis was performed. Results: By overlapping to obtain three AAMR DEGs (TP53INP1, TUBB and RBM47). The results of nomogram and decision curve analysis (DCA) suggested that three AAMR DEGs had diagnostic value for AS and significantly enriched to neutrophil activation, neutrophil degranulation. The proportion of eight kinds of immune cells in AS and normal groups was significantly different, such as activated dendritic cell, CD56 bright natural killer cell, effector memory CD4 T cell. In the miRNA-mRNA regulatory networks, three miRNAs (has-miR-429, has-miR-200c-3p, has-miR-200b-3p) could regulate TP53INP1 and TUBB. There was only one miRNA (has-miR-122-5p) could regulate RBM47. Finally, 51 target drugs (such as colchicine, vinblastine, vincristine) were associated with TUBB. Conclusion: TP53INP1, TUBB and RBM47 might play key roles in AS and could be used as potential biomarkers of AS.