Dying Earth and the Book of the New Sun would be the big two I'd recommend, though their settings are very similar they're very different in tone. Book of the New Sun would be better if you want a more serious read about that kind of world while Dying Earth is more of a collection of (very) humorous and whimsical short stories about a bizarre setting and it's even more bizarre inhabitants.
Hard to be a God was a good read I enjoyed and feels like it falls into this category as well, from the point of the "higher beings."
A lot of famous early pulp fantasy didn't make as much of a concrete distinction between science fiction and fantasy either and tended to blend the two freely. I think most people would think of Conan as pure fantasy but there were a handful of stories about him encountering otherworldly alien beings and sci-fi technology, or ancient highly advanced civilizations whose progress is incomprehensible to (in Conan's world) modern inhabitants. IIRC there was at least one Fahfrd and the Grey Mouser story where they come across an interdimensional traveler.
If other people have recommendations too I'd love for them to chime in. It's a genre I feel is definitely underrepresented.
The Fafhrd & Mouser story (one of them, anyway) is The Swords of Lankhmar, which is absolutely fantastic.
Michael Moorcock is another writer who often mixed fantasy and SF. His Dancers at the End of Time series is brilliant and hilarious. Or more straight-faced and pulpy, the Hawkwind and Elric stories are great.
And Jack Vance, of course. As well as The Dying Earth, he did a bunch of comedy-oriented stories in the same setting, starring Cugel the Clever and Rhialto the Marvellous.
Hard to be a God was a good read I enjoyed and feels like it falls into this category as well, from the point of the "higher beings."
A lot of famous early pulp fantasy didn't make as much of a concrete distinction between science fiction and fantasy either and tended to blend the two freely. I think most people would think of Conan as pure fantasy but there were a handful of stories about him encountering otherworldly alien beings and sci-fi technology, or ancient highly advanced civilizations whose progress is incomprehensible to (in Conan's world) modern inhabitants. IIRC there was at least one Fahfrd and the Grey Mouser story where they come across an interdimensional traveler.
If other people have recommendations too I'd love for them to chime in. It's a genre I feel is definitely underrepresented.