Preheat the air fryer to 400°F.
In a large bowl, combine the olive oil, garlic powder, onion powder, smoked paprika, salt, black pepper, cayenne pepper (if using), and dried thyme. Mix well to create a marinade.
Add the chicken drumsticks to the bowl and toss until they are evenly coated with the marinade. Let them sit for about 15 minutes to absorb the flavors.
Arrange the drumsticks in a single layer in the air fryer basket, ensuring they are not overcrowded. You may need to cook them in batches.
Air fry the drumsticks at 400°F for 25-30 minutes, flipping them halfway through, until they are golden brown and the internal temperature reaches 165°F.
Once cooked, remove the drumsticks from the air fryer and let them rest for 5 minutes before serving.