MIAMI (AP)Right-hander Johnny Cueto’s contract with the Miami Marlins allows him to earn up to $17.5 million over two seasons.

The 36-year-old is guaranteed $8.5 million as part of the deal finalized Thursday. The agreement calls for a $6 million salary in 2023 and includes a $10.5 million team option for 2024 with a $2.5 million buyout.

Cueto can earn up to $250,000 in each season in performance bonuses: $50,000 for 25 starts, 75,000 for 28 and $125,000 for 32, and $50,000 for 50 relief appearances, $75,000 for 55 and $125,000 for 60.

He gets hotel suite on road trips.

Cueto joined a rotation that includes NL Cy Young Award winner Sandy Alcantara, Pablo Lopez, Trevor Rogers, Edward Cabrera, Braxton Garrett and Jesus Luzardo.

Cueto was 8-10 with a 3.35 ERA in 24 starts and one relief appearance with the Chicago White Sox last season. He was an All-Star in 2014 with Cincinnati, finishing second in NL Cy Young voting, and he was an All-Star again in 2016 with San Francisco. He won a World Series with Kansas City in 2015.

Born in San Pedro de Macoris, Cueto’ has a 3.44 career ERA, third-lowest among Dominican pitchers behind Juan Marichal (2.89) and Pedro Martinez (2.93).

More AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports