Different from the conventional gas reservoirs, gas transport in nanoporous shales is complicated due to multiple transport mechanisms and reservoir characteristics. In this work, we presented a unified apparent gas permeability model for real gas transport in organic and inorganic nanopores, considering real gas effect, organic matter (OM) porosity, Knudsen diffusion, surface diffusion, and stress dependence. Meanwhile, the effects of monolayer and multilayer adsorption on gas transport are included. Then, we validated the model by experimental results. The influences of pore radius, pore pressure, OM porosity, temperature, and stress dependence on gas transport behavior and their contributions to the total apparent gas permeability (AGP) were analyzed. The results show that the adsorption effect causes Kn(OM) > Kn(IM) when the pore pressure is larger than 1 MPa and the pore radius is less than 100 nm. The ratio of the AGP over the intrinsic permeability decreases with an increase in pore radius or pore pressure. For nanopores with a radius of less than 10 nm, the effects of the OM porosity, surface diffusion coefficient, and temperature on gas transport cannot be negligible. Moreover, the surface diffusion almost dominates in nanopores with a radius less than 2 nm under high OM porosity conditions. For the small-radius and low-pressure conditions, gas transport is governed by the Knudsen diffusion in nanopores. This study focuses on revealing gas transport behavior in nanoporous shales.