The United States sent CIA agents into Tehran early in the hostage crisis to assist in the escape from Iran of six Americans who were being sheltered by the Canadian Embassy, former president Jimmy Carter has revealed.

Carter, discussing the escape in a talk to correspondents Tuesday in Tokyo, said the agents had gone into Iran under a variety of cover occupations.

The six Americans had eluded Iranian militants who seized the U.S. Embassy and 52 hostages on Nov. 4, 1979, and, after brief stays elsewhere, were taken into the homes of Canadian Ambassador Ken Taylor and other Canadian diplomats. On Jan. 28, 1980, they flew out of Iran, using Canadian passports and forged visas, and Canada then evacuated its own diplomatic staff and closed the embassy. The hostages were not released by Iran until Jan. 20, 1981.

Shortly after the Americans had moved in with the Canadians, Carter said, "I directed that intelligence agencies, primarily the CIA, begin to go into Tehran with disguises--sometimes as a motion picture crew, sometimes otherwise--to go privately into the Canadian Embassy and train these six Americans and the Canadians on how they might best be extracted from Tehran."

In the past, U.S. officials have said only that American intelligence organizations assisted the Canadians in preparing travel documents for the Americans.

Taylor, now the Canadian consul general in New York, told The Associated Press yesterday that the U.S. intelligence agents "made a vital contribution" to the escape.

Taylor said there were "two or three" CIA agents who worked with Canadian officials in Tehran organizing the escape. He said that he was still not "entirely free" to discuss the episode and he that did not know why Carter chose to speak about it.

Meanwhile Victor Tomseth, who was the chief political officer at the U.S. Embassy when it was seized, shed new light on the whereabouts of the six Americans before they were given shelter by the Canadians.

Tomseth, now the State Department's director for the Indian Subcontinent, was at the Iranian Foreign Ministry when the embassy was seized and remained in government hands for more than a year before being put with the hostages at the embassy. From the Foreign Ministry he was able to confer with diplomatic allies by telephone.

Tomseth said in answer to queries yesterday that the six Americans had eluded the Iranian militants for the first two days after the embassy was seized but that, concerned for their safety, he had asked the British Embassy to shelter them.

The British "willingly took them in," Tomseth said, but when that embassy was invaded briefly by militants a day later, he and British diplomats decided that for the safety of the Americans, they should be moved.

Tomseth said he was discussing the matter by phone with French and West German diplomats at the same time, but "we were sure our telephone conversations were being monitored."

So Tomseth, who speaks Thai, contacted Somchai Sriweawneth, a Thai national who was a cook at the U.S. Embassy but had not been taken hostage.

"I was pretty sure it would take the Iranians a while to figure out what language we were talking," Tomseth said, and he hoped that by then he could have the six Americans out of reach of the militants.

He arranged with Somchai to move the Americans into a vacant house until Canadian diplomats took them in a few days later.