Authors - Mohammadmahdi Ghobadi, Renee Bryce Abstract - Modern applications are built from many small services that work together. In these systems, an API gateway plays a key role in routing requests, balancing the load, and processing events. Most API gateways use fixed rules that do not change with shifting workloads, causing delays as high-priority events may be blocked by less critical tasks. In this paper, we propose a new method that uses reinforcement learning to create adaptive API gateways. Our system learns from real-time performance data such as CPU usage, memory usage, event latency, arrival rates of high-priority events, and throughput of low-priority events. By using multiple metrics, the system adjusts its settings to respond to changing conditions. It processes high-priority events immediately while grouping low-priority events into batches for efficient processing. We use the Proximal Policy Optimization (PPO) algorithm because it is stable and effective for learning the best settings. We evaluated our method using simulations that mimic real-world conditions. The results show that our approach reduces the delay for highpriority events by about 41% and significantly lowers the delay for lowpriority events. The system also uses fewer resources than rule-based gateways. These improvements demonstrate that considering multiple performance metrics can lead to smarter, more adaptive API gateways. Our approach adapts very quickly to varying workloads, ensuring remarkably reliable operation during sudden spikes. Our work shows that reinforcement learning can improve API gateway performance for modern applications. This is important for fields such as finance, healthcare, and emergency systems, where fast and reliable responses are critical.