To make star anise water: Combine 1/2 cup water with 1 teaspoon star anise seeds in a small saucepan. Bring to a boil, then let steep for 5 minutes before using.
Preheat the oven: Preheat oven to 350°F and lightly brush a baking sheet with oil.
Dissolve sugar: In a small bowl, mix the sugar and hot star anise water until the sugar is completely dissolved. Set aside.
Make the dough: In another large bowl, combine the flour, baking powder, salt, vanilla, ground anise, anise seeds, and olive oil. Mix until well combined.
Add anise water: Pour in the sugar-anise water mixture and knead until a soft dough forms. If the dough feels sticky, add extra flour a little at a time until smooth.
Shape the cookies: Divide the dough into small equal-sized balls. Roll each ball into a 2-inch rope and shape into a ring (like the letter “O”). Press ends together to seal.
Add sesame seeds: Dip one side of each cookie into sesame seeds, if using, and place them seed-side up on the prepared baking sheet, leaving space between each.
Bake: Bake for 20–25 minutes, or until the cookies are pale golden. They will be soft when done but will crisp as they cool. Avoid overbaking.
Cool and serve: Let cookies cool on the baking sheet, then serve with hot tea.