Set the oven to 170°C.
Cut the peppers into 1cm wide, long slices. Slice the onion. Cut the chilli in half, if used. Scatter these around a baking tray, add 1 Tbsp of oil, season to taste and toss well.
Slice a garlic clove. Make cuts (under the skin) into the chicken flesh and push the garlic slices into the incisions. Roughly crush the other two cloves and toss with the pepper slices.
Cut the lemon into rings. Rub the chicken with the lemon then place the lemon slices on the peppers. Put the chicken thighs on top. Rub or brush the chicken with the remaining oil. Season to taste.
Bake in the oven for 45 minutes until golden brown.
Scatter some basil leaves around just before serving.