Preheat the oven to 375°F.
Combine all the cayenne pepper, black pepper, salt, thyme, garlic powder, paprika, onion powder, and bouillon powder in a small bowl. Mix well.
Remove the neck and giblets from the chicken, rinse and pat dry with a paper towel, then trim off any excess skin and fat.
Add a generous amount of the spice mix to the cavity of the chicken and massage it until well coated.
Pour one tablespoon of olive oil on the chicken and use your hands to spread it all over the chicken. Sprinkle with the rub mixture and massage all over the chicken until fully coated. Flip the chicken over, and massage with some oil and seasoning.
Gently separate the skin of the chicken from its body to create a pocket; season the pocket with some more spice and olive oil.
Stuff the chicken with the onion and rosemary sprigs, tuck the wings back and tie up both legs with a cooking string.
Spread the cut-up onions in a single layer in a shallow baking pan large enough to hold the chicken, and place the chicken over the bed of onions.
Transfer it to the oven and roast for 1 hour and 30 minutes or till the internal temperature reaches 170. Let sit for 10 to 15 minutes before carving.