Like in real life, "god" does not have a clear definition in the Buffyverse. A member of any species can be considered a god or even become one. Some examples are:
Glory was a god sharing the body of a mortal human ("Spiral");
Olaf, transformed into a troll, was called the trollgod ("The Gift");
Cordelia was a half-demon when she ascended ("Tomorrow");
Illyria, an Old One, was often described as a god ("Time Bomb");
Dawn was a human when her "god-like" Key powers were worshiped (In Pieces on the Ground, Part Five).
Several other names are mentioned in prayers and spells during the series, but no other information about these deities is ever described. Some of them are borrowed from real religions (mostly Ancient Egyptian Greek), and, as such, the Buffyverse does not attempt to answer theological questions (heaven, hell, soul are all vague concepts). Therefore, the Buffyverse allows every level of abstraction to be real when asking the question: "What is a god?"
Wikipedia uses a broad definition applicable to the Buffyverse: "A deity or a god is a supernatural being who is considered divine or sacred." (Encyclopedia of Gender and Society). Despite power often being the reason for worship, the definition says nothing about the level of power.
One observation: when first described, Glory is said to be "not a demon. She's a god." ("Checkpoint"). She's the god of a specific hell dimension, but her origins are unknown. Demon is another broad word that covers several species, but, apparently, it does not apply to Glory.
A second observation: when you say "ancients or higher demons," I believe you are referring to the Old Ones, the powerful demons who dominated the Earth before humans. They are not gods by definition, but they could be worshiped and considered one (Illyria is an example), as any other species could.