The robbery occurred shortly before 1:50 a.m. near the intersection of Sutter and Baker streets.
The cabbie, a 70-year-old man, had picked up the suspect and driven him to that intersection, according to police.
When they arrived there, the suspect pulled out a knife, put it to the driver's throat and demanded money, police said.
The victim complied, and the suspect, described only as a man in his 50s, got out of the cab and fled with the cash, according to police.
The cabbie was not injured in the robbery.
Anyone with information about the case is encouraged to call the Police Department's anonymous tip line at (415) 575-4444 or send a tip by text message to TIP411.