The reconstruction of the exchange-correlation potential from accurate ab initio electron densities can provide insights into the limitations of the currently available approximate functionals and provide guidance for devising improved approximations for density-functional theory (DFT). For openshell systems, the spin density is introduced as an additional fundamental variable in spin-DFT. Here, we consider the reconstruction of the corresponding unrestricted Kohn-Sham (KS) potentials from accurate ab initio spin densities. In particular, we investigate whether it is possible to reconstruct the spin exchange-correlation potential, which determines the spin density in unrestricted KS-DFT, despite the numerical difficulties inherent to the optimization of potentials with finite orbital basis sets. We find that the recently developed scheme for unambiguously singling out an optimal optimized potential [Ch. R. Jacob, J. Chem. Phys. 135, 244102 (2011)] can provide such spin potentials accurately. This is demonstrated for two test cases, the lithium atom and the dioxygen molecule, and target (spin) densities from full configuration interaction and complete active space self-consistent field calculations, respectively.