Alphonse Areola made a number of crucial saves as West Ham United frustrated City at London Stadium across 90 minutes, forcing a penalty shootout to settle the tie.
Foden was the only player to miss from the spot, with the Hammers scoring each of their five penalties, Mark Noble netting the first and Said Benrahma the last.
David Moyes' side os now through to the quarter-finals, while City's remarkable run of progressing from its past 21 League Cup ties comes to an end.
The first half was a low-key affair, with Nathan Ake heading the best chance wide just before the break as City struggled to create chances against a stubborn West Ham side.
Shortly after the restart, Ilkay Gundogan spurned a glorious opportunity, steering wide of the far corner after being played through by Cole Palmer, before Arthur Masuaku stung the palms of Zack Steffen from a tight angle.
Areola was then called into action three times in the space of two minutes as he saved from Raheem Sterling and Kevin De Bruyne and then produced a superb stop to repel John Stones's header from close range as City sprung to life.
The Hammers goalkeeper was on hand to rescue his team again with seven minutes of normal time remaining, palming Oleksandr Zinchenko's ferocious strike over the bar.
Sterling headed straight at the goalkeeper with the last chance of the match, forcing City to a shootout that saw Foden critically fluff his lines.