  We clarify the algebraic structure of continuous and discrete quasi-exactly
solvable spectral problems by embedding them into the framework of the quantum
inverse scattering method. The quasi-exactly solvable hamiltonians in one
dimension are identified with traces of quantum monodromy matrices for specific
integrable systems with non-periodic boundary conditions. Applications to the
Azbel-Hofstadter problem are outlined.
