Oil wells are characterized by the presence of natural gas, in particular methane, which is in the liquid state when it is mixed with the oil, then becoming gaseous as it approaches the surface. The APG (associated petroleum gas) is a problem during oil extraction and also for the environment, because it escapes under pressure and can saturate the mining area. To eliminate it, this gas is often flared off, but it could also become a great opportunity if controlled and managed. In particular, it can be exploited for fueling cogeneration plants. The electricity produced by cogeneration can be used in extraction sites, for example in pumping stations like gas and oil, while the thermal energy can be used for a first separating oil at the site and to facilitate the flow of fluid during pumping operations. Even during mining activities, mines will develop natural gas that, for safety and economic reasons, present an opportunity that can be used advantageously for cogeneration.