The marginal marine environments of the eastern tropical Pacific (ETP) serve as an ideal natural laboratory to study how oceanographic and climatic variability influence coral-reef ecosystems. Reefs along the Pacific coast of Panamá span a natural gradient of nutrients, pH, and temperature as a result of stronger seasonal upwelling in the Gulf of Panamá relative to the Gulf of Chiriquí. The ecosystems are not only influenced by spatial and seasonal variations in oceanography but are affected by the climatic variability of the El Niño-Southern Oscillation (ENSO). Foraminifera can be robust indicators of ecosystem condition because the composition of their assemblages and the geochemistry of their tests can change rapidly in response to environmental variability. We studied benthic foraminifera in sediment samples collected from 3 m below mean sea level in the Gulf of Panamá and the Gulf of Chiriquí. Temperature loggers deployed from 2016 to 2019 showed that average temperatures were lower and more variable in the Gulf of Panamá due to seasonal upwelling. All sites in both gulfs were dominated by heterotrophic foraminifera, which was likely the result of nutrient enrichment due to upwelling, combined with ENSO effects. However, the Gulf of Chiriquí was characterized by higher abundances of symbiont-bearing foraminifera than the Gulf of Panamá. The orders Miliolida and Rotaliida dominated the foraminiferal assemblages in both gulfs, with Quinqueloculina and Rosalina being the most abundant genera in the two orders, respectively. Miliolids were less abundant in the Gulf of Panamá than in the Gulf of Chiriquí, whereas rotaliid densities were not significantly different between the two gulfs. Lower pH in the Gulf of Panamá as a result of upwelling may have contributed to the lower abundance of miliolids, which secrete tests of high-magnesium calcite. Geochemical analysis of tests of the symbiont-bearing miliolid Sorites marginalis revealed that foraminiferal Mg/Ca ratios were lower in the Gulf of Panamá than in the Gulf of Chiriquí. The offset in foraminiferal Mg/Ca is consistent with the lower mean annual temperature observed in the Gulf of Panamá due to stronger seasonal upwelling. Because the geochemistry and assemblages of foraminifera reflect differences in environmental conditions, they could potentially be used in tandem with coral proxies to reconstruct past environmental change and project the future of coral-reef systems within the ETP.