D.C. Mayor Marion Barry, fresh from the Democratic National Convention and optimistic about the President Carter's reelection prospects said yesterday that he will campaign up to 15 days for the Carter-Mondale ticket this fall.

Barry, an unenthusiastic Carter supporter before last May's D.C. presidential primary and a low-profile, seldom visible Carter convention delegate, said he will campaign for the president "wherever they want me to go" throughout the U.S.

"I promised (Carter campaign chairman) Bob Strauss that I would give the president 10 to 15 days to campaign," Barry told reporters yesterday." I suspect that they"ll ask me to go into some liberal strongholds. I have some ties with the left."

Barry said he does not expect to campaign for the Democratic ticket primarily in major urban centers with large black populations. Rather, he said, his services would be used to appeal to areas with large liberal constituencies, both black and white, that still remember Barry from his days as a civil rights activist and street organizer in the 1960s.

Those liberal constituencies, he said, may be tempted to vote for independent presidential candidate John B. Anderson of Illinois. "To turn to Anderson is a vote for Reagan," Barry declared.

barry seldom campaigned for Carter during the primaries, and delayed putting a green-and-white Carter placard on the side of his official car until just days before the District's May 6 primary. Sen. Edward M. Kennedy handily won the District primary.

two weeks ago, when disenchanted Democrats were pushing the idea of an "open convention" as a way to dump Carter from the top of the ticket, Barry announced his support for freeing the delegates to vote their political convictions on the first ballot.

however, Barry quickly backed off his "open convention" statement, but not before he anagered some White House aides. At the convention, Barry, unlike Detroit Mayor Coleman Young and Mayor Richard G. Hatcher of Gary, Ind., was not given any prominent convention role.

Thursday night, when most of the nation's well known Democratic mayors were invited to the convention podium in the traditional show of party unity, Barry was already back home, watching the event on television.

He said yesterday he was never asked to appear on the podium for the convention's closing session.

I'm a twinkle instead of a star," Barry said. "I don't need to be on stage and they don't need me on stage. I've got the respect of the White House.

I don't even pretend to be of the same stature politically" as "Hatcher, Young, or San Francisco Mayor Diane Feinstein, Barry said, "I'm not a national leader and I don't want to be one."

Barry said his support of the ticket, and his recent pledge to campaign this fall, were not made under any White House coercion or threat to withhold federal assistance to the city. "The White House doesn't work that way," he said.

barry said that the president is probably trailing nationwide now, but "Carter will get between 60 and 70 percent of the District vote," as well as the city's three electoral votes, he said.