A new treaty on the Panama Canal emerges as the first foreign-policy success of the Carter administration. Since half a dozen other international initiatives have run into the ground, the Panama model is worth studying in detial.

It shows the right relationship between the President and foreign policy, and between this administration and the last one. It also points to the critical need for the administration to develop better rapport with Congress on international questions.

The Panama treaty negotiations have centered on five different points. First there is duration. The new treaty would extend American control over the canal until 2000.

Second, there is the matter of defense after 2000. A codicil gives the U.S. unilateral rights to ensure defense of the canal if its security is threatened.

Third, there is the matter of jurisdiction over the canal. The treaty envisages a progressive turnover to the Panamanians of installations and adjacent territories beginning when the document is formally approved.

Fourth, there is the treatment of the Zonians, the Americans who now live in the Canal Zone and enjoy, relative to the local population, a wide range of benefits. There would continue for all present Zonians but would not be extended to new arrivals.

Finally, there are economic questions, centering on how much the United States will pay Panama for continuing rights over the canal until 2000. The treaty provides that the Panamanians will get several hundred million dollars, payable in various ways including canal revenues.

By almost any measure, that deal is a considerable achievement. It avoids an immediate blowup over the canal that would have long-term repercussions, not only throughout Latin America but also in all U.S. relations with the under-developed world. It ensures this country's security needs at a relatively low price, and without damage to the just rights of the Americans living in the zone.

The achievements is particularly impressive when set against the back-ground of other foreign-policy initiatives by the Carter administration Soviet-American relations have plainly soured since Carter took office. The new approach to the Middle East is bogged down in procedural squabbles. Relations with the leading allies have been troubled by differences on human rights, nuclear power and economic policy.

So the conditions that made the Panama deal possible are almost as interesting as the deal itself. For one thing there was no big, new departure - no move by the Carter administration to achieve a socko success at the expense of its predecessor. On the contrary, the talks were handled jointly by Ellsworth Bunker, the canal negotiator under President Ford, and Sol Linowitz, who was President Carter's representative.

Since no political advantage was at stake, the president kept a relatively low profile. The negotiators, of course, checked their proposals with the President, and Carter, at one critical juncture, sent a letter to Gen. Omar Torrijos, Panama's president, urging him to be moderate in dealing with economic issues. But, except for an ill-advised reference to building a new canal elsewhere, the President did not make the kind of off-the-cutt comments that have caused so much trouble in other areas.

There remains the matter of congressional approval - in this case by both Senate and House. Linowitz and Bunker have already talked to leaders in both parties, including the conservative former governor of California, Ronald Reagan.

Their soundings indicate that the hard-liners grouped around Sen. Henry Jackson to oppose any return toward detente with Russia will not necessarily come into play against the treaty. On the other hand, many legislators not hostile to detente, notably from the South, are uneasy about any cession of American control of the canal.

In other words, no one knows exactly what the legislative propects really are. But it clearly would be a terrible set-back for the administration to negotiate a Panama treaty and fail to win congressional approval. Which means that the administration will have to do a far better job in shaping congressional opinion on Panama than it has so far done on any other foreign-policy matter.