Preheat your oven to 350°F (175°C).
In a large skillet, heat the olive oil over medium heat and add the sliced onions.
Once the onions are caramelized (about 15-20 minutes), add the minced garlic and sauté for an additional 1-2 minutes.
In the same skillet, season the chicken breasts with salt, pepper, and thyme, then nestle them among the onions.
Pour in the chicken broth and balsamic vinegar, bringing it to a gentle simmer.
Stir in the orzo, cover the skillet, and let it cook for 8-10 minutes, stirring occasionally.
Transfer the mixture to a baking dish, then sprinkle the shredded Gruyère cheese on top.
Bake in the preheated oven for about 20-25 minutes, or until the cheese is bubbly and golden.
Remove from the oven and garnish with fresh parsley before serving.