Is the y in baby a vowel or a consonant?

Every syllable must have a vowel. Consequently, the 'y' functions as a vowel. If the 'y' sounds the 'y' in the word 'yes,' it is considered a consonant. Otherwise, it functions as a vowel.