Urban air pollution, particularly carbon monoxide (CO), poses serious health risks, emphasizing the need for accurate prediction models to support real-time monitoring and timely responses. This study explores the use of a Bidirectional Gated Recurrent Unit (Bi-GRU) model to improve CO concentration forecasts, capturing intricate temporal patterns in air quality data. The model, optimized for varying input-output sequences, contributes to advancements in air quality prediction by enhancing accuracy with extended historical data. Using hourly CO data from Yogyakarta, Indonesia, the Bi-GRU model was evaluated across input lengths of 48, 96, and 144 hours with prediction outputs of 24 and 48 hours. Results show high prediction accuracy, with the best performance at 144-hour inputs, achieving an R² of 0.99 and minimal error metrics. These findings underscore the model's reliability and precision in capturing CO fluctuations, making it a promising tool for urban environmental management. This research offers a foundation for further refinement and broader applications in air quality monitoring systems.