We find an integrable generalization of the BCS model with non-uniform
Coulomb and pairing interaction. The Hamiltonian is integrable by construction
since it is a functional of commuting operators; these operators, which
therefore are constants of motion of the model, contain the anisotropic Gaudin
Hamiltonians. The exact solution is obtained diagonalizing them by means of
Bethe Ansatz. Uniform pairing and Coulomb interaction are obtained as the
``isotropic limit'' of the Gaudin Hamiltonians. We discuss possible
applications of this model to a single grain and to a system of few interacting
grains.Comment: 4 pages, revtex. Revised version to be published in Phys. Rev. Let