The paper expresses the problem of flexibility pricing in energy hubs (EHs) that are in connection with electricity, heat, and gas networks considering of uncertain energy generation sources. Scheme includes a bilevel formulation. Its upper-level states for modeling of the flexibility services are provided by various resources within the EH. The problem considers maximization of the expected profit of these resources in the flexibility market. The problem constraints include the flexibility model of flexible resources such as storage devices, responsive loads, and controllable distributed generations (DGs). The flexibility model of resources relies on their active and heat power. The lower-level problem calculates energy and flexibility prices and formulates the flexible operation of energy resources considering EHs. Here, constraints include optimal power flow equations in the energy networks; operation model of EHs with power sources, storage devices, and different responsive loads; and flexibility limits of EHs. Also, a linear approximation model is adopted in the suggested design using conventional linearization techniques. Next, the Karush–Kuhn–Tucker (KKT) method is used to derive a single-level model for the problem. The scheme adopts scenario-based stochastic programming (SBSP) so that uncertainties of renewable power, energy price, load, and energy consumption of mobile storage devices are properly modeled. Finally, the results validate the suggested design’s potential in modifying and enhancing the operation, flexibility, and economic situation of energy networks and EHs.