The sex of a baby can usually be determined through ultrasound between 18-20 weeks of pregnancy. However, it is important to note that the accuracy of determining the baby's sex may vary depending on factors such as the position of the baby and the expertise of the technician performing the ultrasound. In some cases, it may not be possible to determine the sex even at this stage. If you are eager to know your baby's sex, consult with your healthcare provider who can guide you on when and how it can be determined in your specific case.