However, in a contradictory statement, she also denied she killed the girl because she refused to drink the milk she had bought.
She did not formally enter a plea because she was directed to first undergo a psychiatric examination at Mathare Mental Hospital.
Kibera senior resident magistrate Renee Kamau denied bond and ordered the mental assessment before she can enter a plea.
The prosecution said Kamau was a frequent bhang smoker who smoked during pregnancy and after giving birth.
The prosecution also alleged that after killing her daughter, she hid her for some time before the neighbours noticed the girl was missing and reported to Kilimani police station.
Kamau said she was financially unstable and wanted the court to help her get some cash. She said their home was in Nyeri and she asked why her case was taking so long.
The case will be mentioned on May 13.