The 22-year-old Sock was leading Belgium's Ruben Bemelmans 6-4, 6-4, 3-6, 1-2 when he started cramping and was forced to retire.
Sock, the 28th seed, then collapsed on the court, where he was treated with ice packs and cold towels by US Open medical staff before being helped off to the shade of the Grandstand Court.
He became the 11th man to retire from a match at this year's tournament, which has been played in 30-plus heat every day.
Two women also retired in the first round, taking the total for this year's US Open to 14.
More From This Section
Temperatures have been over 30 degrees (86 degrees Fahrenheit) all week with humidity hitting 40 percent on Thursday at a steamy Flushing Meadows.
The carnage led again to suggestions that the men, who play the best of five sets, should be accorded the same protection as women players.
"I honestly don't know what I want to see. I'm normally OK with heat and humidity," said French Open champion Stan Wawrinka. "I don't have problem physically. Never retired because of that. Never had really big cramping or big problem because of that.
"For me, it's fine. I'm still OK with no rule."
Sock later said he had recovered and was looking ahead to playing in the Davis Cup play-off tie against Uzbekistan in Tashkent later this month.
"I want to thank everyone for their support and can't wait to be back next year. I feel better already and look forward to playing Davis Cup."
The sight of Sock being carried off also sparked calls for a new look at the scheduling especially for players involved in other events.
"@usopen if we want men's singles players @JackSock to keep playing doubles then scheduling needs to improve or even fewer will play both," tweeted former US player turned television pundit Pam Shriver.