Three goals in ten first half minutes put City well in control at the London Stadium before Sergio Aguero and John Stones added second-half goals.
Yaya Toure opened the scoring for City from the spot after they were controversially awarded a penalty when Pablo Zabaleta collided with Angelo Ogbonna.
Then West Ham fell apart. Havard Nordtveit turned Bacary Sagna's cross into his own net, before David Silva tapped in from close range.
Aguero deflected in Toure's shot in the 50th minute to make it 4-0 and Stones wrapped up an emphatic win by heading in his first City goal with six minutes left.