We present here a general theoretical procedure to treat the problem of electron delocalization and magnetic interactions in high-nuclearity mixed valence clusters based on polyoxometalates. The main interactions between the delocalized electrons of mixed-valence polyoxometalate anions are extracted from valence spectroscopy ab initio calculations on embedded fragments. Electron transfer, magnetic coupling and exchange transfer parameters between nearest and next-nearest-neighbor metal ions, as well as the value of the electrostatic repulsion between pairs of metal ions are determined. These parameters are introduced in a model Hamiltonian that considers the whole anion. It thus provides macroscopic properties that should be compared with the experimental data. This method is applied to a two-electron-reduced polyoxowolframate Keggin anion. The results demonstrate that the electron transfer processes, combined with the Coulombic repulsion between the "extra" electrons, induce a strong antiferromagnetic coupling between the two delocalized spins providing a definite explanation of the diamagnetic properties of these high nuclearity mixed-valence clusters.