Preheat your oven to 425°F (220°C).
In a small bowl, mix together the olive oil, garlic powder, onion powder, smoked paprika, salt, black pepper, and cayenne pepper (if using) to create a spice rub.
Pat the chicken thighs dry with paper towels. Rub the spice mixture all over the chicken thighs, ensuring they are well coated.
Place the chicken thighs skin-side up on a baking sheet lined with aluminum foil or parchment paper for easy cleanup.
Bake in the preheated oven for 25 minutes.
Remove the chicken from the oven and brush a generous amount of barbecue sauce on each thigh.
Return the chicken to the oven and bake for an additional 10-15 minutes, or until the internal temperature reaches 165°F (75°C) and the skin is crispy.
Let the chicken rest for 5 minutes before serving.