Chelsea's midfielder Eden Hazard (R) shoots past West Ham United's goalkeeper Darren Randolph to score on March 6, 2017Chelsea's midfielder Eden Hazard (R) shoots past West Ham United's goalkeeper Darren Randolph to score on March 6, 2017 (AFP Photo/Adrian DENNIS)
"I think we played a good game," Chelsea manager Conte told Sky Sports.
"We controlled the game. It's a pity for the goal we conceded at the end. To give away a clean sheet at the end is not good.
"We must improve in this situation. But I'm pleased. We showed great concentration and commitment and will to win."
With Tottenham Hotspur and Manchester City having won at the weekend, this was a test of Chelsea's nerve, but their assured display suggested there will be few bumps on the road to the title.
Hazard, in particular, brimmed with self-belief, at one point using his back to play a showy pass to N'Golo Kante, while Costa took his tally for the season to 18 goals in all competitions.
West Ham had won 2-1 when the sides last met in the League Cup in October, but Lanzini's late strike gave the final score at London Stadium a slightly misleading gloss for the home side.
"Chelsea are where they are for a reason," said West Ham manager Slaven Bilic, whose team remain 11th in the table.
"To beat them, you need them to make mistakes, not the other way round."
Andy Carroll's return after a month out with a groin injury gave Bilic's men a welcome attacking focal point and they looked for the towering striker at every opportunity.
Robert Snodgrass and Lanzini curled a succession of testing crosses into the Chelsea box, but the visitors withstood the aerial onslaught before taking the lead in ruthless fashion.
All it took was a misplaced Mark Noble pass to set Chelsea off, with Kante intercepting the loose ball before ferrying a pass down the left touchline to Hazard, who moved it infield to Pedro.
- Fan intrusion -
No sooner had he released the ball than Hazard was darting in behind the West Ham defence.
Pedro's pass found the Belgian and he nudged the ball wide of advancing goalkeeper Darren Randolph before steering a shot into the vacant net for his 11th goal of the season.
In a troubling moment, an irate male West Ham fan in a black anorak and jeans vaulted the advertising hoardings and attempted to confront Hazard as he celebrated, but was held back by stewards.
It took until the 40th minute for West Ham to muster an attempt worthy of the name, Lanzini swapping passes with Noble and blazing over.
They were fortunate to reach the interval only a goal behind after Chelsea spurned three clear-cut chances in rapid succession.
Hazard's cross was completely missed by Costa, Victor Moses saw an effort blocked by a stretching Aaron Cresswell and Pedro's follow-up was palmed away by Randolph.
Costa atoned for his miscue five minutes into the second half by doubling Chelsea's lead, guiding the ball into the net with his knee after Cesc Fabregas's corner had glanced off Pedro Obiang's head.
Marcos Alonso threatened to kill West Ham off for good moments later when he danced past Jose Fonte and dinked a shot wide.
But it proved the precursor to the hosts' strongest period of the match.
Carroll curled in an effort that brushed the roof netting, Snodgrass worried Thibaut Courtois with a cross-shot and Fonte headed wide moments after Moses had blocked from Sofiane Feghouli.
Conte stiffened his midfield in response, sending on Nemanja Matic for Pedro and switching to a 5-3-2 configuration.
The switch succeeded in snuffing out the hosts' revival and although Lanzini halved the arrears with a low drive, after Randolph had saved from Costa at the other end, victory never looked in doubt.