Preheat the oven to 170°C (325°F, Gas Mark 3).
Place the onions in a deep casserole dish with the olive oil, the thyme, a little salt and the cayenne pepper. Sit the cleaned chicken on top of the onions, season with salt and pepper. Cover the casserole and