I know the question is old, but is possible to give an exact characterization to d, at least if it's a prime number:
it is known that considering a prime p ≡ 1(mod4), there is always a solution to x² - py² = -1 in integers, the proof is from Mordell "Diophantine Equations" pages 55-56 (thanks to @Will Jagy for pointing that out).
Furthermore Dirichlet proved that if the prime p ≡ 1(mod4) and p ≡ 5(mod8) or p ≡ 9(mod16), the equation x² - 2py² = -1 has still integer solutions (references https://www.forgottenbooks.com/en/download/ThePellEquation_10024828.pdf pag. 80)
Here the proof that if the prime p ≡ 5(mod8) then the equation x² - 2pᵃy² = -1 has integer solutions http://archive.ymsc.tsinghua.edu.cn/pacm_download/21/241-2013The_solvability_of_negative_Pell_equation.pdf