Preheat your oven to 375°F (190°C).
In a large skillet, heat the olive oil over medium heat. Add the sliced onions, salt, and pepper. Sauté for about 10-15 minutes, stirring frequently, until the onions are soft and caramelized.
Once the onions are caramelized, lower the heat and add the thyme and beef broth. Allow it to simmer for about 5 minutes, letting the flavors meld together.
While the onion mixture is simmering, season the chicken breasts with salt and pepper. In a separate baking dish, place the chicken breasts and pour any remaining broth mixture over them.
Top each chicken breast with the caramelized onion mixture. Spread the Gruyère cheese evenly over the top of the onions.
Cover the baking dish with foil and bake in the preheated oven for 20 minutes. Then, remove the foil and bake for an additional 10-15 minutes, or until the cheese is bubbly and golden brown, and the chicken is cooked through (165°F/75°C internal temperature).
Remove from the oven and let it rest for a few minutes. Garnish with freshly chopped parsley and a drizzle of balsamic vinegar if desired.