The Iranian-American financial settlement, details of which were revealed yesterday, is an agreement that gives something to all the parties involved.

But some clearly gained more than others, a fact assuring that it will be the subject of lawsuits for years to come.

Iran got back $2.8 billion of its own money, which had been frozen and beyond its reach for 14 months.

However, at least $4 million worth of Iranian assets remains frozen pending the resolution of legal claims by U.S. banks, companies and individuals.

And, under the agreement, the Iranian government did not get a single penny of the late shah's assets -- the return of which was once a major and emotional condition of the release of the hostages.

Iran also secured the removal of trade restrictions that had prevented it from buying goods not only in the United States but in western Europe.

Major American banks wind up in a far better position than they were before then-president Carter's freeze order of Nov. 14, 1979.

Under the agreement, $3.7 billion of their loans to the former government of the late shah Mohammad Reza Pahlavi were paid back yesterday, 100 cents on the dollars, and a procedure was established for repayment of $1.4 billion in additional loans the banks had made to other Iranian borrowers.

Yet 14 months ago, just before the freeze was instituted, officials of the regime of Ayatollah Ruhollah Khomeini were threatening not to repay any of these loans, and to withdraw their deposits from the banks.

Companies and individuals with financial claims against the Iranian government are assured of a legal procedure for seeking damages or compensation for unpaid bills and lost property or equipment. The forum is the International Arbitral Tribunal.

However, unlike the banks, the companies have no assurance that they will be reimbursed the full values of their claims. The U.S. government will have the right to appoint only one third of the tribunal's members, and it could be before the claims are settled. t

Under the agreement's terms, money to pay off valid claims of the companies and individuals will begin to move into a special account, from still frozen Iranian accounts in the United States, in the next six months. This special "security" account will be be filled until it reaches $1 billion.Iran has also agreed to keep at least $500 million in this account until all disputes are settled.

More than 300 claims suits totaling mor than $3 billion already have been filed against the Iranian government in U.S. courts, and the Treasury Department has identified 3,000 companies or individuals who have additional claims pending, though not in court.

One official described many of the claims as "simply not reliable."

However, former attorney general Benjamin R. Civiletti said there "undoubtedly will be litigation" challenging the U.S. government's right to do such things as releasing frozen Iranian funds which are now the subject of court attachment orders.

The first legal battle over the agreement is to begin this morning in U.S. District Court here.

A former Iranian national plans to file suit against the Tehran government, seeking payment for his former business and home in Iran he says have been nationalized. This action probably will be imitated by other claimants, dissatisfied with the deal that was struck.

Today his lawyer is to move in court to have a temporary restraining order approved to prevent the movement of any more of Iran's frozen assets from the United States.

The Iranian government's Washington attorney, Thomas G. Shack, has been served with legal papers in the case, and reportedly will be in court to argue against the action.

The key question, however, is whethe the Reagan administration will pick up the challenge. The Carter administration agreement calls for the United States to defend Iran against such actions and move within 380 lawsuits that have been files against Iran in courts throughout the country.

If Reagan administration lawyers do not follow through and these lawsuits are not canceled, the remaining frozen assets in the United States will not be able to be moved and the rest of agreement could fall apart.

One group of American claimants already has drawn together to challenge the agreement, according to one Washington attorney.

This group is outraged at a clause added to the agreement which they say would keep them from presenting their cases to the international tribunal.

The clause, passed a week ago by the Iranian Majlis (parliament) as part of the legislation authorizing the international body, excludes from the process those claims that arose out of contracts which specifically said that disputes were to be settled within the "sole jurisdiction of the competent Iranian courts."

Estimates vary as to how many contracts now is court contain such clauses. But one American who formerly practiced law in Tehran said that in his three years of work there most contracts contained wording similar to that used by the Majlis.

Government officials yesterday aid it will be up the the international tribunal to decide which cases it takes. And an Iranian lawyer said there were contracts that said disputes should be adjudicated in accord with Iranian law, but not necessarily before an Iranian court.

The impending legal battles over the agreement may revive again the bitterness among private lawyers representing company claimants toward former deputy secretary of the treasury Robert Carswell.

Before coming to Washington, Carswell was a partner in the prestigious New York City Law firm of Sherman and Sterling, one of whose top clients was the second-largest American bank, Citicorp.

Complaints first emerged when Carswell was a key architect of the Nov. 14, 1979, Treasury regulations implementing the presidential freeze order. The regulations permitted the banks to "set off" defaulted Iranian loans with frozen Iranian deposits.

It also allowed companies and individuals with claims against Iran to file them in court and seek attachments against the frozen funds. Attachments are legal orders that would keep those funds as temporary property of the court until the claims are finally adjudicated.

Within days after the freeze, Iranian bank officials were complaining in Tehran about Caldwell's actions, saying he was acting on behalf of his former law firm in permitting "setoffs" and legal claims to be filed against the frozen funds, which were the property of the Iranian government and thus not subject to legal action under the tradtional legal doctrine of sovereign immunity. The Carswell regulations ordered that doctrine set aside, as long as the presidential freeze order was in effect.

On Monday, the attack on Carswell came from American lawyers with corporate clients having claims against Iran.

"The deal stinks to high heaven," one lawyer said yesterday, referring primarily to the settlement given the banks as against that given his clients.

However, it was learned that it was not Carswell's idea to have the American commercial bank loans paid up right away using the transferred frozen assets. It was an idea put forward suddenly last week by the Iranians, and it took Carswell and the bankers by surprise.

Another conflict is brewing out of the current ambiguity that exists over the future of the military spare parts and equipment that Iran had bought and paid for before the freeze -- but that had not been shipped.

The Carter administration position was described last week by then-defense secretary Harold Brown, who told reporters that "The arms themselves were not an issue in the negotiations . . . because the Iranians did not make it an issue."

Brown took that to mean that Iran didn't want them.

Iranian sources said last week, however, that the the negotiators never mentioned the weapons because they didn't want to appear publicly to be seeking them. But Prime Minister Mohammed Ali Rajai told a news conference a month ago that he expected the purchased arms to be included in any return of assets.

And, an Iranian source added, the provision of the agreement referring to release of "other assets in the U.S. and abroad" that specifies "transfer to Iran of all Iranian properties which are located in the United States and abroad" is expected to bring them the military purchases.

The first test here should come when Iran tries to get its hands on some helicopter parts that have been held at the Italian facility of the American Bell Helicopter Co. These parts have not been subjected to any legal attachments, since they are abroad, and thus no bar should now exist to their transfer to Iran once an agreement was signed, Tehran sources said recently.

There are also questions as to just how much equipment remains under the control of the Pentagon. A trust fund used to purchase arms for Iran held about $400 million, and Brown acknowledged that there was another $500 million that was paid for and stored.

Whether the Reagan Pentagon will now deliver these items or require Iran to ask for them and seek licenses to get them transferred out of the United States will probably be the focus of future talks between the two countries.