SAN FRANCISCO—At the Clift Hotel in San Francisco, there are more than 370 rooms inside—and 100,000 bees buzzing above in rooftop hives outside. Yes, honeybees.

Aware of the well-publicized environmental threats to honeybees that have reduced numbers worldwide, seven San Francisco hotels have built hives on their rooftops. The sustainability effort also benefits the hotels as the bees produce honey for cocktails, food and spa treatments.

It’s the latest in a series of environmental programs at hotels, which includes low-flow toilets and aggressive recycling programs.

“This is not about making money, it’s really about raising awareness about sustainability,” said Melissa Farrar, spokesman at the Fairmont in San Francisco. “There’s not one solution so we wanted to do our part to help. It’s part of the bigger effort for helping the planet.”

Farrar said the four hives on the rooftop garden support about 250,000 bees and produce about 1,000 pounds of honey each year.

In this foodie city, the honey is used in such things as the Clift’s Purple Haze drink with gin-infused lavender, honey syrup and lavender bitters, and their compressed watermelon salad with lavender-infused honey and goat cheese. Honey is used in beer at the Fairmont Hotel, and the jars of the product are sold in the gift shop. At the W, they make honey ice cream. The bee hives at hotels are not new, but the effort is growing every year.

Fairmont’s first beehives were built in 2008 at the company’s hotels in Toronto and in Vancouver in an effort to help combat Colony Collapse Disorder. Since then, dozens have been installed at Fairmonts from Seattle to China and Africa.

At the Clift, high above the city on the rooftop garden, 10 hives are buzzing with activity. Most guests don’t even know they are there. But the fruits of their labor are evident in the cocktails and food. You won’t find the squeezable honey bear container in Chef Thomas Weibull’s kitchen.

“Since we are chefs in California, we like to use a lot of things that are local,” he said, talking about his pork-adobo appetizer with a honey glaze. “Ninety-five percent of our products are local and sustainable.”

The bees produced more than 70 pounds of honey last year and are on track to do much more this year. The colony is expected to grow to 800,000 by next year, General Manager Michael Pace said.

His interest in bee hotels started last year when he took on the job of chairman of the Sustainability Committee for the Hotel Council of San Francisco. He spearheaded a larger effort between numerous local hotels to put bees on their rooftops as well. There are now seven hotels from Nob Hill to Fisherman’s Wharf with rooftop hives.

At six of the hotels, the man who tends the hives is Roger Garrison, a waiter at the W San Francisco turned beekeeper. At the W, Garrison, who seems to like serving bees as much as people, configured the boxy hives like miniature skyscrapers to mimic the city grid below, with the gold dome of City Hall in the distance.

Sometimes the job is painless.

“Most of the time you just open the hives and everything is copasetic,” he said.

Other times, it’s not. He gets stung almost daily.

“It’s like taking a daily vitamin,” he said.

But the payoff is big. Last year, the hotel produced 300 pounds of honey.

Garrison cares for and tracks the bees. He said they have a natural GPS system that allows them to fly up from the 32nd floor up to two miles daily to forage for pollen and find their way back to the hive.

“There’s a lot of gardens in San Francisco that aren’t visible to the eye but are visible to bees,” he said.