Preheat your oven to 350°F (175°C). Grease a 9-inch pie pan with cooking spray or butter.
In a large mixing bowl, whisk together the sugar, flour, cocoa powder, baking powder, and salt until well combined.
Add the milk, melted butter, and vanilla extract to the dry ingredients. Stir until the mixture is smooth and well blended.
Fold in the chocolate chips and nuts (if using) until evenly distributed.
Pour the batter into the prepared pie pan, spreading it evenly.
Bake in the preheated oven for 25-30 minutes, or until the edges are set but the center is still slightly gooey.
Remove from the oven and let it cool for about 10 minutes before serving.
Serve warm with a scoop of vanilla ice cream on top for a delightful contrast.