I used peppermint oil to try and deter ants that were coming in round the window frame in our dining room (get this problem every year) and I must say, it was rather effective. The ants went absolutely beserk at the smell of the oil, only problem was, they went the wrong way - not outside, but swarming further in!
Our guineas live in the lounge, which adjoins the dining room, sort of open plan, but not quite. One reason why I wanted to use peppermint oil rather than any ant spray / powder was thinking it would be harmless for the guinea pigs. I don't have anything to back that up, it was just what I thought, based on the fact that the peppermint lives in the kitchen cupboard, and not the garden shed. Also, I didn't actually spray it around, I just put a few drops on a kitchen towel, and put it on the windowsill. The guineas' cages would be about 20 feet away from there, maybe.
Personally, I wouldn't spray anything into the air where the guinea pigs are, as I imagine it would irritate their airways, even if it wasn't actually harmful as such. Better safe than sorry.