Gonzalez's agreement includes a spring invite to big-league camp.
The 35-year-old spent last season with the Chicago White Sox. The two-time All-Star appeared in 12 games - four starts - posting a 4.83 ERA in 31 2/3 innings.
Gonzalez has amassed 131 wins and a 3.70 ERA over 13 major-league seasons, with his finest campaign coming in 2012 with the Washington Nationals when he won 21 games and finished third in National League Cy Young voting.
The native of Hialeah, Florida, should provide Miami's rotation with veteran stability should he make the team out of camp.