No, you should be considered the legal guardian of the child by default because you are the mother.
If the father wants custody of the child he is the one who'll have to file for custody. Part of the procedure will be a paternity test which he must pass to have any sort of basis for custody.
Being the mother, and considering that you never married the father, your custody of the child should be secure as long as you provide adequate support for the child. The father is the one who has to file for custody and do the legal work for custody. Even then he has little chance of securing even partial custody since you never married.