Anthem is definitely a piece of dystopian literature: it's all about the nightmarish society where essentially everything is bad. Like the other classics of the genre (such as 1984, Brave New World, and The Giver), it's also meant to me a warning that we may be heading there.
Anthem's also clearly a work of philosophical literature. It's meant to illustrate and promote Ayn Rand's own distinctive philosophy of egoism, and to critique all forms of collectivism. The two opposed worldviews are embodied in the story's heroes, on the one hand, and the evil and oppressive society that opposes them, on the other. (Technically, by the way, Rand's philosophy is called Objectivism, but she hadn't yet come up with the name or all of the elements of her later Objectivism when she wrote this book).
Anthem could also be called a fantasy. In part, that's because the world of the story is completely made up, but even more than that it's because something about it feels myth-like.
Finally, Anthem is a satire. The collectivistic society it portrays may be terrifying, but it's also so absurdly self-contradictory it's hard not to find it ridiculous.