Lee Bowyer's opening-half goal - his first for nearly 12 months - earned Alex McLeish's side a shock victory on Saturday.
But their hero was Foster who bounced back from his error on England duty in midweek with a series of stunning saves.
Chelsea dominated proceedings for the entire 90 minutes but they could not find a way past the former Manchester United player.
It was a vastly improved performance by Chelsea compared to their 3-0 home mauling by Sunderland last weekend.
But they tasted defeat in back to back league games for the first time since the end of the 2005-2006 campaign and they now only lead Manchester United on goal difference.
In addition to Foster, City centre-backs Scott Dann and Roger Johnson were outstanding.
Chelsea were quickly into their stride and Salomon Kalou missed an early chance to put them ahead.
Didier Drogba's flick found Kalou with only Foster to beat but his shot went through the legs of the keeper and just past the post.
Foster made a fine save to keep Birmingham on level terms after Drogba was sent clear by Kalou.
It was the kind of chance Drogba would normally convert but Foster raced off his line to reduce the angle and saved low to his left.
Chelsea had quickly established a grip of the game and were taking advantage of having an extra midfield player.
But Birmingham stunned Chelsea by taking their lead via their first worthwhile attack after 17 minutes.
Sebastian Larsson's right-wing cross was headed down by Cameron Jerome to Bowyer who was completely unmarked and lashed the ball past Petr Cech for his first goal of the season.
Chelsea tried to retaliate and Foster went down to his right to hold onto Drogba's effort from the right of the box.
He then made a superb reflex save to keep out Drogba's close range header from Nicolas Anelka's centre.
Chelsea continued to dominate and Foster again did well to beat out an Ashley Cole shot after he had sized onto a pass from Kalou.
Chelsea were carving chances almost at will and Alex had a free header from Florent Malouda's corner but directed it past the post.
Drogba tried his luck with a low 30 yard free-kick and Foster was again alert to turn it around the post.
But he was helpless after 38 minutes when Drogba crashed a header against the crossbar from Malouda's cross.
Ramires was first to react to the rebound but from eight yards out slashed his shot wide.
Chelsea continued in the same manner after the break although there were less clearcut openings.
Johnson produced a superb tackle to stop Ramires after his run into the box needed treatment to his knee before being able to continue.
Kalou had Chelsea's best chance to date of the second period when turning back inside but he curled his shot over the bar with Foster off his line.
Carlo Ancelotti brought on Jose Boswinga in place of Paulo Ferreira after 65 minutes.
The chances started to come again for the visitors with Foster holding onto a Drogba free-kick and Kalou heading wide from Anelka's cross.
Scott Dann's back pass played in Kalou but Foster took the ball away from his feet with a perfectly timed challenge.
Foster parried aside an Branislav Ivanovic header as the pressure again became relentless.
Liam Ridgewell was yellow carded for bringing down Boswinga but Chelsea could not find a way through.