To improve performance and optimize rumen function in yaks (Bos grunniens), further knowledge on the appropriate dietary protein levels for ruminal microbiota and the metabolite profiles of yaks in feedlot feeding is necessary. Current understanding of dietary protein requirements, ruminal microbiota, and metabolites is limited. In this study, yaks were fed a low-protein diet (L; 9.64%), middle low-protein diet (ML; 11.25%), middle high-protein diet (MH; 12.48%), or a high-protein diet (H; 13.87%), and the effects of those diets on changes and interactions in ruminal microbiota and metabolites were investigated. Twenty-four female yaks were selected, and the effects on ruminal microbiota and metabolites were investigated using 16s rRNA gene sequencing and gas chromatography time-of-flight/mass spectrometry (GC-TOF/MS). Diets containing different protein levels changed the composition of the rumen bacterial community, the H group significantly reduced the diversity of ruminal microbiota (p < 0.05), and the number of shared amplicon sequence variants (ASVs) between the H group and the other three groups was lower, suggesting that the ruminal microbiota community fluctuated more with a high-protein diet. In rumen, Bacteroidetes, Firmicutes, and Proteobacteria were the most abundant bacteria at the phylum level, and Bacteroidetes was significantly less abundant in the MH group than in the L and ML groups (p < 0.05). Prevotella_1, Rikenellaceae_RC9_gut_group, and Christensenellaceae_R-7_group had the highest abundance at the genus level. Prevotellaceae was enriched in the low-protein groups, whereas Bacteroidales_BS11_gut_group was enriched in the high-protein groups. Rumen metabolite concentrations and metabolic patterns were altered by dietary protein levels: organic acid metabolites, antioxidant-related metabolites, and some plant-derived metabolites showed variation between the groups. Enrichment analysis revealed that significant changes were concentrated in six pathways, including the citrate cycle (TCA cycle), glyoxylate and dicarboxylate metabolism, and butanoate metabolism. Network analysis showed promotion or restraint relationships between different rumen microbiota and metabolites. Overall, the rumen function was higher in the MH group. This study provides a reference for appropriate dietary protein levels and improves understanding of rumen microbes and metabolites.