The escalating demand for large-scale energy storage solutions has sparked significant interest in metal-ion batteries, particularly in the realm of high-performance anode materials. This work explores the potential of penta-BP2 as an anode material for sodium and potassium-ion batteries through first-principles calculations. The two-dimensional metallic structure of penta-BP2 exhibits favorable electrical conductivity, making it an ideal candidate for anode materials. Theoretical analysis reveals that penta-BP2 can adsorb two layers of Na and three layers of K, resulting in high storage capacities of 1105 and 1473 mAh/g, along with low open-circuit voltages of 0.40 and 0.30 V, respectively. These characteristics enable the production of high energy density in sodium and potassium-ion batteries. Additionally, the material's small Young's modulus and low diffusion energy barriers further establish penta-BP2 as a flexible anode material capable of rapid charge/discharge processes.