South Africa chase record 259 as Johnson Charles and Quinton de Kock hit hundreds.
South Africa were in trouble at 87 for 4 before Klaasen partnered with Miller and Jansen to make light work of the target.
West Indies has a 1-0 lead in the series. The first ODI was abandoned without a ball bowled.
South Africa won the second Test against West Indies in Johannesburg by 284 runs.
New South Africa captain Temba Bavuma took control in Test against the West indies thanks to a drought-ending 171 not out at the Wanderers.
South Africa were 311 for 7 at stumps on the second day, with Markram and de Zorzi score fifties.
Markram announced as new T20I captain; South Africa name squads for West Indies limited-overs leg.
Roach five-for and Blackwood fifty went in vain in Test that finished in three days.
A searing spell from Anrich Nortje saw South Africa gain a big lead in the first innings.