President Carter mixed politics, fund raising and the arts tonight for the benefit of an old political ally.

The president and his wife, Rosalynn, flew here early in the evening to attend a glittering black-tie dinner and later a performance of the opera "Aida."

The price tag for the two events at the Metropolitan Opera House was $2,500 a couple, and the beneficiary was former New York mayor Abraham D. Beame, who, until tonight, owed $321,000 from his losing primary campaign for reelection last year.

More than 200 attended the events, wiping out much of the Beame debt.

While Carter had raised money for the Democratic Party and Democratic candidates, the evening was unusual in that it was to benefit an out-of-office politician. But Beame was the first major New York Democrat to support Carter in 1976, a fact the president clearly has not forgotten.

In brief remarks to the dinner crowd, the president recalled Beame's early support and the former mayor's efforts to gain federal loan guarantees and other support for financially troubled New York City.

"He is the most unselfish political figure I have ever known," Carter said of Beame. "I have never heard him even insinuate a request that would benefit Abe Beame. It was always New York City alone."

He added that while New York still faces financial problems, it made great strides toward achieving solvency under Beame's leadership.

Carter, who is sensitive about his height, also said of the 5-foot-2 former mayor, "With me Abe Beame stands tall."

The president and Mrs. Carter were scheduled to return to Washington early Wednesday morning.