THE AYATOLLAH Khomeini may not realize what he has done. As a result of his actions in the past four weeks, the Vietnam war is now over in the American mind. Americans have, at last, stopped fighting it -- and stopped losing it. Perhaps nothing more important has happened as a consequence of the gross events in Iran.

The manner in which the Americn people have steadied themselves, under great provocation, is not merely a matter for the well-deserved tributes which have been paid to them. It is an event which has altered the standing of America in its own eyes and the eyes of the world.

After the first days of angry and frustrated response to the events in Iran, much less has been heard of the "helpless giant," and there have been many fewer calls for "something to be done." Only a nation that is strong and feels sure could act with such firmness, while at the same time setting such an example of preverving the habits of civility between nations; indeed, of preserving the peace in a hostile situation, and not striking a spark in a tinderbox.

One has waited a long time for this. One has waited, to go back no further, since the Tet offensive. But one has only had to listen in the past four weks to hear a people who are again ready to acknowledge, with a unity which is impressive, that the occasion may and is likely one day to come when they must gird themselves to use their power abroad. It is as if the '70s are over.

If the United States does not backslide when the immediate crisis is resolved -- or take actions merely out of vengeance, actions which do not serve its real interests -- it is a commanding position to strengthen old alliances, restore some that are broken and even create some new ones. For what matters is that its government and its people have showed again a great confidence in themselves and so displayed to the world that they have in them the power to command.

It has always seemed obvious to me that anti-Americanism is strongest abroad when Americans' confidence in themselves is weak. Most of the rest of the world pins so many of its hopes on America -- whatever the shouts in the streets, whatever the slogans on the walls -- that it cannot bear any sign that it is America that has lost its own faith. Anit-Americanism is like the blind anger of children whose parents do not exert their authority. But now America has displayed its authority.

With all of that said, now the reservations. One of the few unpromising responses in the past four weeks came after the attack on the American embassy in Pakistan, when one heard commontators like the hosts of radio call-in shows ask the silly but loaded question, "Why are we hated so much?" Behind such a question is a kind of narcissism, which sees the world in terms only of one's own injured feelings.

Not all anti-American demonstrations are eviddence of any deep anti-Americanism. Those who take to the streets, after all, must have something to shut against. It is a weakness of Americans to think that when slogans or even actions take an anti-American from, anti-Americanism is therefore the main motive. But if one is the top guy, alas one will usually be the fall guy. Much is going on in the countries of the Third World just now which has only a tenuous connection with America. But America is naturally a scapegoat, as Britain was in the 29th century.

Caliban would have found it unbearable to see himself in the mirror. So when the Calibans in some countries today do look on their own reflections, they are more than likely to scream that the ugly features are those of America. The awakening of the Third World is the mighiest event of our time, and we need always to remember, as Reinhold Niebuhr put it 27 years ago, that "decades upon decades will be required to bring order out of this chaos."

But behind the question, "Why are we hated so much?", there lies something else. It is usually said that America wants too much to be loved in their dealings with other nations. There is something to this -- they give food to the Indians, and expect the Indians to be grateful, when they are more likely to be envious -- but it is not really the point.

Niebuhr was again nearer the heart of it when he spoke of "This vast [American] involvement in guilt in a supposedly innocent world." [He was writing when America had just assumed the responsibilities of world power, which is why it is worth returning to his words in "The Irony of American History."] This vast involvement in guilt of the American people was, he said, met partly be a culture which pretended to "know nothing of sin or guilt."

"Our culture knows little or nothing of the use and the abuse of power." America is a society "in which the morally embarrassing factor of power has been pushed under the rug." The nation has "seemed to be the most perfect fruit of that culture," always trying to perpetuate its imagined and longed for state of "infant innocence."

Every conversation of Americans to which I have listened in the past four weeks has reflected exactly this diagnosis. There has been the rekindling of patriotism, even among the most tender of internationalists. There has been the expressed desire to stand up and fight somewhere, even from the most pacific and waif-like of liberals whom I know. But then there has been the yearning to do it all without the danger of incurring any guilt.

This is the root cause of any genuine anti-Americanism to which Americans need pay attention. Their allies especially have a severe and persistent doubt, not whether America has the power, not even whether it has the will, but whether it will not always be suddenly struck by a guilt which frustrates it at the crucial moments.

The weaker partners in an alliance need to be certain that their protector will not grow nerveless in their defense when its own interests are not directly at stake. Thucydides tells us how the Corinthians spoke to the Lacedaemonians when the possibility of an alliance was at issue: "Justice with you seems to consist in giving no annoyance to others and in defending yourselves only against positive injury." They are words that ring down history: that to fight for one's allies is to fight for oneself.

No one has ever seriously doubted America's willingness or capacity to do so, except in this one respect which we are discussing, that it can still be tempted to try to escape from the moral predicaments of power and of history. This has been the main doubt since the Tet offensive, and why I say that the ayatollah may have brought the Vietnam war to an end: For I have seldom known so much air to be cleared so quickly. w

In fact it needs to be said that one of the things which has counted in the past few weeks is that it has been less the politicians and the press who have steadied the people than the people who have steadied them. Although much credit must be given to the example set by President Carter, it has not really been necessary to meet or quell any violent temper in the people.

Althugh our eyes and our anguish may be fixed on the embassy in Tehran, our minds should be looking much further afield, for there seems to me to be no doubt that by their conduct in the past four weeks. the Americans have placed themselves once again in a position from which they can lead. Beside the opportunities this offers, meeting the "positive injury" is in the end secondary.