The thermophoretic motion of a spherical particle situated at the center of a spherical cavity filled with a gaseous medium under a prescribed temperature gradient is studied analytically. The Knudsen number is small for the gas motion in the slip-flow regime, and the temperature jump, thermal creep, frictional slip, and particularly, thermal stress slip are allowed on the solid surfaces. After solving the equations of heat conduction and fluid motion, an explicit formula for the migration velocity of the confined particle is obtained for different temperature conditions of the cavity with arbitrary values of the particle-to-cavity radius ratio and other parameters. Contributions from the thermoosmotic flow along the cavity wall and from the wall-corrected thermophoretic force to the particle velocity are equivalently important and can be linearly superimposed. With either or both of these contributions, the particle velocity in general is a decreasing function of the particle-to-cavity radius ratio and vanishes in the limit. The effects of the thermal stress slip at the solid surfaces to the migration velocity of the confined particle can be significant and interesting, dependent on the thermal and interfacial properties of the particle and surrounding gas. The wall effect on the thermophoretic migration of the particle in a cavity is qualitatively different from that on the motion of the particle in a circular tube.