Blood test for gender

How many weeks do you have to be to find out your babies gender by blood test?