Prep the pan: Heat oven to 350°F (175°C). Grease an 8-inch round or square pan and line the bottom with parchment.
Melt the chocolate: In a microwave-safe bowl, melt 3 ounces dark chocolate in 20–30 second bursts, stirring until smooth. Set aside to cool slightly.
Mix the dry ingredients: In a large bowl, whisk 1 1/2 cups oat flour, 1/2 cup cocoa, 1 teaspoon baking powder, 1/2 teaspoon baking soda, and 1/2 teaspoon salt.
If using, add 1 teaspoon espresso powder.
Combine the wet ingredients: Add 3/4 cup sugar, 2 large eggs, 1/3 cup oil, 1/2 cup milk, 1/3 cup yogurt, and 2 teaspoons vanilla to the bowl. Whisk until mostly smooth.
Stir in the chocolate: Pour in the melted chocolate and stir until the batter is glossy and thick. Avoid overmixing.
Fill the pan: Scrape the batter into the prepared pan.
Smooth the top. Sprinkle on a handful of chocolate chips if you like.
Bake: Bake 24–30 minutes, until the edges are set and a toothpick comes out with a few moist crumbs. Do not overbake—this keeps the cake fudgy.
Cool: Let the cake cool in the pan for 15 minutes, then transfer to a rack to cool completely.
Optional ganache: Warm 1/2 cup heavy cream until steaming. Pour over 4 ounces chopped chocolate and let sit 2 minutes, then stir smooth.
Spread over the cooled cake.