Japanese Prime Minister Masayoshi Ohira yesterday pledged a $1-million gift to help build the proposed $13-million annex to the Freer Gallery of Art.

The announcement came on the eve of his 21/2-day official visit when he and President Carter are expected to discuss the growing dispute over U.S. Japan trade differences, and in the midst of the Japan Today celebration in seven American cities.

Ohira plans to tell the president today that his government is pledging a total of $4 million to American/Japanese cultural and scientific projects, according to the Japanese Embassy. The other gifts are: $1 million to help construct a $1.7-million Japanese gallery to house more than 20,500 objects at the Metropolitan Museum of Art in New York; $1 million toward building a $19-million Asia Society headquaters also in New York; and $1 million to establish an international energy policy research fund at the Massachusetts Institute of Technology.

While political tensions continue to rise over the $11.5 billion trade deficit, Ohira chose to focus on Japan's cultural generosity yesterday as he made his appointed grounds with a ceremonial visit to Arlington National Cemetery.

At the Freer, the Smithsonian's oriental gallery, he was welcomed by Smithsonian Secretary Dillon Ripley in a Japanese gallery where a model of the proposed annex by Japanese architect Junzo Yoshimura was the center of attention. Ripley had shown the model to Ohira Recently in Tokyo. The party then toured the Japanese lacquer show with Tom Lawton, Freer director, and Ann Fonemurax, assistant curator.

The gift to the oriental gallery comes as Congress today considers an appropriation of $500,000 planning money on the proposal to build the Freer annex and a second structure to house the Museum of African Art on the South Lawn of the Smithsonian. The $1-million gift to the Freer is expected to prod Congress into acting favorably on the proposal.

At the Kennedy Center, Ohira saw Japan's $3-million Bicentennial gift, the Terrace Theater. When it opened earlier this year, the 500-seat theater added another dimension to the center's facilities because of its relatively intimate size.

At the Cleveland Park headquarters of an international student exchange program called Youth for Understanding, Ohira saw the results of a $650,000 joint gift from seven Japanese corporations. It was called the Japan Building, and handing him an honorary key to the door was former Sen. Hugh Scot of Pennsylvania, chairman of YFU's board of trustees.

Another building on the grounds, Scott pointed out, has been designated the Datsun Building. It was made possible by a $750,000 gift to YFU from the Nissan Motor Co.

"One of the most compelling tasks today is to learn to understand each other better and to live together in peace and cooperation across cultural boundaries," Ohira told an audience that included more than two dozen American and Japanese students currently involved in the YFU's Japan Project.

That word "understanding" had cropped up earlier when Mike Mansfield, former majority leader of the Senate before Carter named him envoy to Japan, was talking with reporters about Ohira's visit.

"I hope it will be productive, worthwhile and better our mutual understanding," he said, adding that he also hoped it would "teach us the virtues of patience."

With trade negotiations between the Japanese and American governments at a virtual standstill, and with congressional pressure mounting for the Japanese to open their market to U.S. competition, Mansfield said he was hopeful "it will work out."

At YFU headquarters, Ohira's remarks were in English, drawing admiring comments later from Japanese reporters who waylaid him for an impromptu news conference.

"Young people are the hope for the future," he said, but sidestepped the immediate future and his discussions with President Carter.

"Tomorrow is tomorrow," he said, flashing a broad grin and hurrying off to a waiting limousine. CAPTION:

Picture 1, Okira, left, with his interpreter, wife Shigeko and S. Dillon Ripley, by UPI.; Picture 2, Model for South Lawn Smithsonian museums, foreground, from left: Freer, Freer Annex, African Art, Arts and Industries; the Castle is in the background. Photo by Richard Holmeister.