Cities are socioecological systems that filter and select species, therefore establishing unique species assemblages and biotic interactions. Urban ecosystems can host richer wild bee communities than highly intensified agricultural areas, specifically in resource-rich urban green spaces such as allotments and family gardens. At the same time, urban beekeeping has boomed in many European cities, raising concerns that the fast addition of a large number of managed bees could deplete the existing floral resources, triggering competition between wild bees and honeybees. Here, we studied the interplay between resource availability and the number of honeybees at local and landscape scales and how this relationship influences wild bee diversity. We collected wild bees and honeybees in a pollination experiment using four standardized plant species with distinct floral morphologies. We performed the experiment in 23 urban gardens in the city of Zurich (Switzerland), distributed along gradients of urban and local management intensity, and measured functional traits related to resource use. At each site, we quantified the feeding niche partitioning (calculated as the average distance in the multidimensional trait space) between the wild bee community and the honeybee population. Using multilevel structural equation models (SEM), we tested direct and indirect effects of resource availability, urban beekeeping, and wild bees on the community feeding niche partitioning. We found an increase in feeding niche partitioning with increasing wild bee species richness. Moreover, feeding niche partitioning tended to increase in experimental sites with lower resource availability at the landscape scale, which had lower abundances of honeybees. However, beekeeping intensity at the local and landscape scales did not directly influence community feeding niche partitioning or wild bee species richness. In addition, wild bee species richness was positively influenced by local resource availability, whereas local honeybee abundance was positively affected by landscape resource availability. Overall, these results suggest that Joan Casanelles-Abella and Simone Fontana are joint first authors.