Place the chicken in a bowl and squeeze in the juice of 1½ lemons.
Add the garlic and chilli.
Mix to coat the chicken well and leave to marinate in the refrigerator for at least 1 hour.
Preheat a hot barbecue, grill, griddle or dry frying pan.
Remove the chicken from the marinade and brush it with oil.
Place the chicken, skin-side towards the heat, on the barbecue, under the grill, on the griddle or in the pan, and cook for about 4-5 minutes on each side, until well colored and cooked through, but be careful not to let it dry out.
While the chicken cooks, cut the onions into medium-thin slices.
Heat a few drops of oil in a deep frying pan and fry the onions with the thyme for about 5-8 minutes until nice and brown, allowing their sweetness to come out.
Remove the onions from the pan and set aside on a warm plate.
Pour the juice of 1 lemon and the chicken stock into the pan, bring to the boil and season with salt and pepper to taste.
Allow it to reduce slightly, stirring and scraping the bottom of the pan to get up all the taste.
Arrange the chicken on a plate, top with the onions and pour the lemon sauce over it.