President Carter, calling the Iran-Iraq conflict "a very dangerous situation," warned yesterday that freedom for ships to navigate the Persian Gulf is vital to the world's oil supplies and said he is consulting with other nations about how to ensure that freedom.

After a meeting with his chief national security advisers, Carter appeared before reporters at the White House to read a statement in which he laid heavy stress on the need for oil shipments to continue through the gulf without interruption.

The president said that, because of high oil inventories in the major consuming countries, the suspension of oil shipments from Iraq and Iran should not cause shortages or undue price increases. But he added:

"Of course, a total suspension of oil exports from the other nations who ship through the Persian Gulf region would create a serious threat to the world's oil supplies and consequently a threat to the economic health of all nations."

He continued, "Freedom of navigation in the Persian Gulf is of primary importance to the whole international community. It is imperative that there be no infringement of that freedom of passage of ships to and from the Persian Gulf region."

His words fueled speculation, which began building earlier yesterday, that the United States might be trying to work out with other countries an initiative such as an international flotilla of ships to sail through the Straight of Hormuz, which commands the entrance to the gulf, as a warning that Iran and Iraq should not interfere with neutral ships.

However, when Carter was asked what actions he would take to keep the gulf open, he said only: "We're consulting other nations about what ought to be done to keep the Straight of Hormuz open, and therefore access to the Persian Gulf."

Administration officials said later that the president's comments should not be interpreted as meaning that the United States has decided on any specific course of action.

Carter's purpose, the officials insisted, was to underscore the importance the United States attaches to the navigation question and to inform the American people that the administration is consulting with other governments about possible actions.

According to the officials, these consultations are in a highly preliminary stage and are being conducted primarily by Secretary of State Edmund S. Muskie in his meetings with foreign ministers gatheres in New York for the U.N. General Assembly. Muskie interrupted his U.N. talks to come here yesterday for the White House meeting, but he returned to New York immediately afterward.

During a brief encounter with reporters in New York, Muskie also sought to dampen speculation that some specific plan is in the works. He noted that, while Iran has declared the waters within its 12-mile territorial limits a "war zone," it has not yet impeded any vessels, and he added that to speculate about future developments would not be helpful.

In addition to the work being done by Muskie, Carter said that he personally has been in contact with the leaders of some countries. White House officials refused to specify what governments were involved, but hinted that they included at least some of America's principal allies among the western industrial nations.

In his statement, Carter reiterated the line laid down by the administration Monday that the United States is strictly neutral in the conflict, and added that "charges to the contrary are obviously and patently false." Some factions in Iran have accused the United States of instigating Iraq to start the fighting.

Asserting that the dispute "should be settled at the negotiating table and not on the battlefield," the president said the United States "strongly supports" efforts under way in the United Nations to find a mechanism of obtaining a cease-fire and mediation of the conflict.

In New York, Muskie called pursuit of a cease-fire "the first priority," and said it would be among the chief topics when he meets today with Soviet Foreign Minister Andrel A. Gromyko. The Soviet Union is Iraq's chief arms supplier, but U.S. officials say there is no evidence that the Soviets have been involved in the conflict.

Carter also sought to ease concern about the conflict's causing oil shortages and higher prices. He said:

"Oil inventories in the world's major oil-consuming nations are now at an all-time high. The world's margin of oil supply is much greater today than in the winter of 1978 and '79, when the Iranian revolution reduced oil supplies were very low . . . . Hence there is no reason for repetition of the shortages or the price escalation that resulted in 1979."

Referring to the American hostages in Iran, Carter said: "We continue our work for their prompt release, and we continue to hold the government of Iran responsible for their safety and their well-being."

As the president was leaving the press room, a reporter asked if the United States would trade spare parts for Iran's largely American-made military equipment in exchange for the hostages' release. Carter replied:

"We're consulting through other means with Iran, as we have been for many months, about a safe release of the hostages, but that particular point would perhaps be better for me not to single out among the others."

Republican presidential nominee Ronald Reagan, after a long discussion with his advisers, issued the following statement about the Iran-Iraqi comflict.

"The situation involving Iran and Iraq is both serious and unfortunate, not only because the American hostages are in danger but also because it could spread into a general war and because it threatens the world's oil supplies.

"What's happening in Iran and Iraq is the consequence of policies this administration has followed during the last 3 1/i years. A vacillating foreign policy and a weakened defense capability are largely to blame. It is up to President Carter now to decide what role the United States must play, and I will make no further comment at this time."

Reagan read the statement from the steps outside the Farah manufacturing plant during a campaign stop in El Paso. He declined to answer any questions.

White House press secretary Jody Powell promptly called Reagan's comment "absurd," and said, "We don't see anything to be gained by politicizing this crises."

The State Department announced that, while it plans to keep the U.S. interests section in Baghdad open, it has ordered dependents of U.S. officials to leave Iraq immediately. The department also said it has imformation that approximately 150 Americans have fled the Basra area of Iraq, which came under Iranian air attact Tuesday, to neighboring Kuwait.