Preheat oven to 375°F (190°C).
In a large skillet, melt butter over medium heat. Add sliced onions and cook, stirring occasionally, until deeply caramelized, about 20-25 minutes.
Stir in minced garlic and thyme, cooking for 1 minute. Pour in beef broth to deglaze the pan, scraping up browned bits, and simmer until liquid is reduced by half.
Season chicken breasts with salt and pepper. Cut a pocket into the side of each breast without cutting all the way through.
Stuff each pocket with 1 tablespoon of caramelized onions and 2 tablespoons of shredded Gruyere. Secure with toothpicks if necessary.
In an oven-safe skillet, heat olive oil over medium-high heat. Sear chicken for 3-4 minutes per side until golden brown.
Top chicken with remaining caramelized onions and remaining Gruyere cheese.
Place baguette slices or croutons on top of the cheese.
Transfer the skillet to the oven and bake for 15-20 minutes until the chicken reaches an internal temperature of 165°F (74°C) and cheese is bubbly and browned.