Context. Some kinetic models of the solar wind, such as the exospheric ones, make certain assumptions about the solar plasma, which for modelling purposes is generally considered collisionless and quasi-neutral. They also assume specific distribution functions for the electron and proton populations from which the fundamental properties of the plasma, including the density, are calculated using the moment integrals. Imposing the quasi-neutrality condition leads to the presence of an ambipolar electrostatic field, which is responsible for the acceleration of the wind. Usually, the calculation of the moment integrals is complicated by the fact that most kinetic models assume different trajectories for the solar wind components, separating the integrals into chunks corresponding to the pitch angles defining the trajectories. Hence, up to now all these integrals and therefore the plasma fundamental quantities have been calculated numerically. Aims. A new model is presented that makes use of similar assumptions to other kinetic collisionless models but does not need to impose the separation of the populations in different trajectories for the calculation of the integrals. As a consequence, an analytic solution for the electrostatic potential of the solar wind valid for all distances is found. Methods. A kinetic collisionless approach was used to characterise the solar wind plasma. A single equation for the electrostatic potential function was found assuming certain distribution functions (Maxwellian or non-thermal such as Kappa), which include an unknown electrostatic potential, calculating the density integral for those distribution functions and making those densities equal for electrons and protons. Results. An analytic solution for the electrostatic potential as a function of radial distance is found (for the first time for all distances) and shown to produce a non-monotonic total potential, which is compatible with other models like the exospheric ones whose electrostatic potential drives the acceleration of the solar wind. This expression can now be used, in a straightforward way, to provide insight into the importance of the electron distribution functions to shape the electrostatic potential of thermal solar-like outflows.