NICOSIA, CYPRUS, MAY 31 -- Iranian Foreign Minister Ali Akbar Velayati warned the United States and the Soviet Union today against intervening in the Persian Gulf war as Tehran announced that seven Kuwaiti speedboats had been detained while "spying" for Iraq.

Observers suggested that Iran has embarked on a major propaganda exercise to strengthen congressional critics of the Reagan administration's plan to provide U.S. Navy escorts for Kuwaiti tankers "reflagged" as American ships.

The official Iranian news agency, IRNA, gave few details about the Kuwaiti speedboats but said they were detained "recently" while the crews, later arrested, pretended to fish near the Khour Abdullah estuary at the head of the gulf. There was no immediate reaction from Kuwait.

The 15-mile-wide estuary lies between Kuwait's Bubiyan Island and Faw Peninsula, which Iranian forces captured in January 1986.

IRNA said the speedboat crews had "confessed" to charges of spying for Iraq, thus proving Kuwait's "new treachery." For months, Tehran has singled out Kuwait, a small, essentially defenseless oil-producing state within earshot of Iranian artillery on Faw, by attacking its tankers in the gulf.

Those attacks prompted Kuwait to seek help from both Moscow and Washington. President Reagan announced yesterday that the United States has agreed to protect reflagged Kuwaiti shipping. The Soviets are leasing three tankers to Kuwait and have sent minesweepers to the gulf.

{Meanwhile, on the syndicated television program "John McLaughlin: One on One," Iraq's ambassador to the United States, Nizar Hamdoon, replied that he was "not sure" when asked whether Kuwaiti vessels to be flying U.S. flags would be carrying weapons to Iraq.}

Iranian foreign minister Velayati, in a stopover in Abu Dhabi during his current visit to Arab gulf states, reiterated his country's opposition to superpower involvement in the gulf, which Tehran has denounced as disguised aid to Iraq.

Describing his country as the "most powerful in the gulf," Velayati told a news conference that Iran would "not allow the superpowers or any other force to interfere in the region."

While warning that Iran would not tolerate foreign powers turning the gulf into a "toy in their hands," he nonetheless remained vague when asked what action Tehran would take if the superpowers beefed up their fleets in the confined waters of the gulf.

Velayati said that Iran would "deal with each incident according to the circumstances."

Strategists have suggested that Iran has little interest in directly challenging the superpowers, especially the United States, by attacking warships or commercial ships flying their flags.

U.S. carrier-based air power is credited with the capability of inflicting serious damage on Iran's vulnerable oil refineries, oil pumping stations and naval bases. But analysts have warned that the consequences of such action on the future of American-Iranian relations could redound to the advantage of the Soviet Union, which shares a 1,600-mile frontier with Iran.

Meanwhile today, Sens. John Glenn (D-Ohio) and John W. Warner (R-Va.) flew over the Strait of Hormuz in an Omani Air Force helicopter as part of their assignment from Senate Majority Leader Robert C. Byrd (D-W.Va.) to tour the gulf after the Iraqi missile attack May 17 on the frigate USS Stark that killed 37 sailors and wounded 21.

The sultanate of Oman and Iran are on opposite sides of the strait, through which the gulf's oil exports pass. The senators later moved on to Saudi Arabia.