The fortunes of 1400 I St., a large office building whose empty floors typified Washington's office space glut a year ago, have improved dramatically as those of the sex shows across the street have declined.

The 164,000-square-foot building, which stood empty for months, an embarrassment and a financial drain on its owners, a group of Washington developers, attorneys, real estate brokers and an architect, is now almost fully occupied. And its owners' now largely successful struggles to lease it up provide an insight into the recent history of the downtown office market.

The building has been named the United Press International Building in honor of its biggest tenant, which received a 5 percent ownership stake in the structure as part of what a UPI spokesman described as very generous leasing terms.

The wire service, occupying nearly 30,000 square feet on two floors, is by far the largest of the building's 23 tenants. The other occupants, with offices ranging from 2,000 to 15,000 square feet, include law firms, nonprofit organizations, the American Postal Workers Union AFL-CIO, a Spanish news agency and other miscellaneous groups and businesses. The building, sitting atop the 14th Street entrance to the McPherson Square Metro station, contains 154,000 square feet of office space and 10,000 square feet of retail space, also fully leased. The last tenants to sign up plan to open a restaurant called Mingles on the lower ground level of the building.

"We are pleased with the way things have gone. This is a nice deal for us," said developer Edward Lenkin, who, with his parents and sister, owns 36 percent of the building. Edward and Mel Lenkin, his father, were among the many developers who built east of 15th Street NW when available land grew scarce in the traditional business neighborhood west of 16th Street. Scores of buildings mushroomed on the east side just as the recession struck in the early 1980s, bringing office space leasing almost to a standstill.

With 10.5 million square feet of office space for rent in the city in the spring of 1983, 3.5 million of it east of 15th Street, the competition for tenants was fierce, and concessions offered by landlords included low rent, months of free rent, free finishing of office interiors and even ownership interests in the buildings. One landlord reportedly provided limousine service for a tenant so that he could return to his former neighborhood each day for lunch.

The asking price for space in 1400 I was $18.75 to $25.75 per square foot during the desperate search for occupants, and leases actually signed specified rents in the "high teens and low 20s," said an industry source. Most of the leases provide for rent increases in three to five years, or are for terms of only three or five years, to give the owners an early opportunity to raise the price.

The amount of rent being collected now means the building's owners will lose money for three years before they begin to break even, and will not start making money until the end of five years, the source said, adding, "They've stopped hemorrhaging, but they're still bleeding."

The cost of maintaining the building while it was empty was estimated at $3.23 million annually, including $510,000 annual rent to the Washington Metropolitan Area Transit Authority, which owns the land on which the building stands. The developers have a 50-year lease with an option to extend for another 49 years.

Owners of the building would not discuss rents and costs, but James L. Eichberg, one of the owners and president of Smithy Braedon real estate brokers, said, "I would say it is carrying itself. Nobody's asked me for money." Lenkin declined to comment on the income, saying, "I'm never sure" what profit means in the real estate business.

Zoning lawyer Robert Linowes, a partner in the building, also said, "I think it's carrying itself," and estimated it would begin to turn a profit in "three or four years." Linowes said he feels "wonderful" now that 1400 I is almost fully leased. "I never really had any doubt. It was a question of time" before the building was filled, he said.

New investors, a group of Washington-area residents, have been brought into the building, according to Lenkin, who would not identify them. Documents of 14th and Eye Streets Associates, the limited partnership set up to develop the property, were filed with the city government in January 1981, and no additional papers have been filed since, according to a staff member in the corporations division of the Department of Consumer and Regulatory Affairs.

With the UPI building more than 95 percent leased and many others east of 15th Street 70 percent leased or more, developers all over the area are breathing sighs of relief. Confirmation this week that the Inter-American Development Bank and the owners of the huge Daon building at 1300 New York Ave. have agreed to work toward a long-term lease of the building's 750,000 square feet brought even more relief, along with expectations that rents would soon begin to go up. One commercial broker said the vast, empty building was "a sword of Damocles" hanging over the commercial real estate market.

The space glut in the old downtown was created when many developers ignored or misread signs of the declining market in their eagerness to build, and underestimated tenant reluctance to move into the seedy, unfashionable East Side neighborhoods. Some lost their buildings, but most had sufficiently "deep pockets," the industry phrase for owners with plenty of capital, to carry their buildings through the bad times.

Edward Lenkin said he "absolutely" would erect another office building in the area. "In the long run, it certainly is an area that has a lot of land available, and it has a nice park Franklin Square to build around," in addition to the Metro subway system, he said.

The Lenkins' building stands on the southwest corner of 14th and I streets, across the intersection from Franklin Square, and across 14th from the area's most notorious, block-long strip of sexually oriented clubs, shows and bookstores. Both the square, which was litter-strewn and frequented by derelicts until recently, and the sex businesses have been the target of energetic cleanup efforts by the Franklin Square Association, organized by developers and other businesses new to the area. The square has been spruced up and some of the sex-related businesses have been shut down or face closing.

The porno patrons and panhandlers still roam 14th Street south of Franklin Park, but "nothing really serious" goes on, said a UPI staffer.

"Remember, the majority of us the wire service's 250 employes here moved down from New York" where their offices were on 42nd Street, said another, William K. Adler, vice president for information services. "So most of us felt this was quite tame.

"If we have important visitors we try to take them in around the side of the building" so they don't get a good look at 14th Street, he said. Adler is "impressed" with what has been done to push out the sex businesses, and thinks "five years is a conservative estimate for the time it will take the neighborhood to come back.

"We are glad to get in on the trend" upward, he said. UPI, with a lease for half the rent it paid in New York, was attracted by a "total package" of terms that included a moving allowance, generous allowance for finishing the offices' interior, naming the building, and the ownership share.

"I've never been hassled" in the neighborhood, said Victoria Wakefield, UPI's regional sales executive for Washington. "I'm not nervous about this building, and I don't think my colleagues are."