Sergio Aguero broke the deadlock for City in the first half after some great build-up play, but the Hammers battled hard to stay in the game and had their opportunities to equalise.
However, Yaya Toure's tremendous strike with seven minutes remaining put the result beyond doubt and cemented City's standing in second place, with Joe Hart's stoppage-time fumble from Andy Carroll coming too late to give West Ham a chance.
Having seen Manchester United clinch the title with a win over Aston Villa on Monday, Roberto Mancini's men were determined to respond in style and welcomed David Silva back from injury after he missed the 3-1 defeat at Tottenham Hotspur.
Silva fired a shot narrowly wide in the early stages as City immediately settled into a fluent rhythm, while Aguero scuffed an effort against the post after the ball had deflected fortunately into his path.
As supporters of both clubs applauded after 23 minutes for Marc-Vivien Foe, who died ten years ago, City goalkeeper Hart was tested for the first time by a powerful Mohamed Diame volley through a crowded penalty area.
But it was City who opened the scoring on 28 minutes following a sumptuous passing move, with Samir Nasri playing an intricate one-two with Silva before cutting the ball back for Aguero to sweep in a finish from close range.
It was nearly 2-0 moments later as Jussi Jaaskelainen pulled off a superb double save, first parrying a long-range Nasri drive and then getting up quickly to deny Pablo Zabaleta on the rebound.
City stayed in control for the remainder of the first half but West Ham came out strongly after the interval and Zabaleta did well to clear a threatening cross from Matt Jarvis towards the back post.
The Hammers also had appeals for a penalty waved away by referee Howard Webb as a Jarvis cross struck Zabaleta on the arm, before City regained the initiative.
Carlos Tevez had an effort brilliantly blocked by Joey O'Brien before Nasri squandered a glorious opportunity to double City's lead when he failed to get a proper connection on his shot from close range at the back post.
Nerves started to creep in at the back for City as the clock ticked down and James Collins fired narrowly wide, before the tension was released by a ferocious strike by Toure from the edge of the area in the 83rd minute that flew into the top corner.
City had chances to further extend their advantage and Hart also had to make a save from Carroll's header in a frantic finale, before the England goalkeeper embarrassingly failed to keep out a strike from the same player and allowed the ball to squirm through his legs just before the final whistle.