Iga Swiatek served for a spot in the final in the 12th game of the third set and had a match point before Madison Keys triumphed in the most thrilling contest of the tournament to date.