The Proteas batted first and posted a total of 249-4 and restricted the hosts to 240-8 to secure the win (in a rain interrupted match which was reduced to 40 overs) and attempt to secure automatic qualification for the 2023 World Cup.
With India at 118-5 the match looked almost over but Sanju Samson changed things by hammering 86 off 63 balls to set up a thrilling final over. Tabraiz Shamsi (8-0-89-1) was given the job to bowl the last over and took the Proteas to victory by defending the 30 runs needed to win allowing the home-side to only score 20.
On an ideal pitch for spinners, SA's Keshav Maharaj gave a great bowling performance with figures of 8-1-23-1. The Proteas quickies also helped pave the way for the result with Kagiso Rabada (2-36) and Lungi Ngidi (3-52).
They key thing for the Proteas was the unbeaten fifth wicket partnership of 119 between Klaasen and Miller.
Klaasen scored 74 off 65 balls (6x4, 2x6) and Miller made 75 from 63 balls with five fours and three sixes. At one stage the Proteas were at 110/4 in the 23rd over, until the Klaasen and Miller onslaught.
Rabada and Wayne Parnell got the needed early wickets for the Proteas. Rabada bowling Shubman Gill (3) before captain Shikhar Dhawan (4) played on to Parnell.
Shamsi got the wickets of Ruturaj Gaikwad for 19 runs off 42 deliveries and also Ishan Kishan (20 from 37 balls) who was caught at leg slip.
Shreyas Iyer then score 50 from 37 balls but pulled a shot off Lungi Ngidi to get caught at mid-on by Rabada for India to sit at 118-5.
Sanju Samson came in and almost changed the match with 28 runs coming from the 36th and 37th overs to leave a target of 45 required from the final three overs for the win.
Earlier, Proteas opener Janneman Malan scored 22 from 42 balls before falling to Shardul Thakur. SA captain started well by scoring eight runs via two fours but then a quality ball from Thakur hit his off stump in the next over after 12 balls.
Wrist-spinner Kuldeep Yadav bowled Aiden Markram (0) to leave South Africa at 71-3 after 16 overs.
The second ODI is scheduled to take place on Sunday at JSCA International Stadium Complex (Ranchi).