Six teams each qualified for the National League (NL) and American League (AL) playoffs, which start with best-of-three wildcard series play.
The Yankees will host archrival Boston, with the winner advancing to face AL top seed Tampa Bay in the best-of-five division series.
Slugger Aaron Judge, recovering from a calf strain after missing 84 games earlier with a rib injury, aims to return against the Red Sox. The Yankees were 7-6 against Boston this season.
“My goal is to come back as soon as I can,” outfielder Judge said.
“Ask me if I’m going to be back I’ll tell you yeah.”
Yankees manager Aaron Boone was more cautious, saying, “We’ll listen to the trainers and medical and see where we’re at.”
Last-day qualifier Houston — the AL West winners with the worst record in playoff history, at 81-81 — will host the Chicago White Sox in the other AL series. The Astros won the regular-season series 5-2.
The winner meets Cleveland, which also earned a first-round bye.
In the NL, San Diego will play host to the Chicago Cubs, who went 5-1 against the Padres, with the winner advancing to face NL top seed Milwaukee, which won an MLB-best 103 games this season.
The other NL wildcard series sends Philadelphia, which survived four straight losses to qualify on the last day, against Atlanta, which went 9-4 against the Phillies.
The winner will visit Dodger Stadium for a division series opener on Saturday.