  We study the ODE/IM correspondence for ODE associated to $\hat{\mathfrak
g}$-valued connections, for a simply-laced Lie algebra $\mathfrak g$. We prove
that subdominant solutions to the ODE defined in different fundamental
representations satisfy a set of quadratic equations called $\Psi$-system. This
allows us to show that the generalized spectral determinants satisfy the Bethe
Ansatz equations.
