Black Africa's biggest, meanest city bares its soul every day out on the freeway.

It is a rush-hour afternoon, and traffic is stuck on a six-lane bridge over Lagos Lagoon.

Miles of cars -- windows shut, air-conditioning full-blast, doors locked -- creep through a greenish-gray pall of exhaust and humidity. Horns bleat incessantly as sealed-off drivers appear, at times, to be screaming.

Beneath the traffic is Lagos Lagoon, a fetid reservoir of garbage, rusting shipwrecks and sewage. Ahead, on shore to the left, great mounds of demolished buildings, sprinkled with mutilated car bodies and barefoot children. Ahead, on shore to the right, the Holy Church of Cherubim and Seraphim.

On the freeway itself, the business of Lagos rages. An army of shirtless, barefoot, needle-legged teen-agers weaves through traffic, clicking fingernails on windshields and selling dishcloths, screwdrivers, cough drops, baby shoes, argyle socks, telephones, lobsters, shower mats, four kinds of rat poison.

Aging blind men, dodging cars by clutching the hands of children, beg car-to-car, fingering their earnings on the median strip.

Lagos, the swampy West African port city that has grown in the past 20 years from 700,000 to 6 million people, is famous for being horrible.

The mere mention of the word "Lagos" makes frequent travelers on this continent wince. Foreign businessmen file off airplanes here with faces that fail to conceal fear.

Yet, compared with conditions during the 1970s, the squalor of the city has eased a bit; crime is down, amenities have improved, traffic flows a little better. Ironically, the improvements can be attributed to economic stagnation caused by the world oil glut.

But by just about any measure of the quality of urban life, the city's notoriety is well deserved.

For starters, nearly every time it rains, one-third of Lagos floods. Half the city has no sewers or septic tanks, relying instead on the "pail" system of waste disposal. Drinking water is scarce. What fresh water lines there are leak, and most are submerged in flowing sewage, sucking in disease when water pressure drops.

The average commuter endures two to three hours a day on the road. Those who walk, in a city chronically short of sidewalks, footpaths and street lights, risk falling into roadside ditches that are green with fermenting sewage.

The list of bad things is long and depressing. A recent World Bank assessment of Lagos said the city "places a hardship on all urban residents, who have to live with numerous traffic snarls, flooding, power failures, water shortages, and a generally poor, inefficient and unhealthy environment."

Misery does not come cheap in Lagos. As it has been for nearly a decade, the capital of Nigeria remains the world's most expensive city. A Chinese dinner for one costs $50. A European newspaper is $5. Two-bedroom apartments rent for $85,000 a year, three years payable in advance.

The Union Bank of Switzerland, in a survey this year, found that goods and services were more expensive in Lagos than anywhere in the world. The bank reported that, exclusive of rent, living here costs an average of $2,010 a month, $410 more than in New York City. While New York has the highest average hourly wages in the world, the Swiss bank found that hourly wages in Lagos are among the lowest in the 49 cities surveyed.

On top of it all, the oil-dependent economy of Lagos has been skidding for much of the past five years. But recent hard times have conspired to make life in this city slightly less brutish than it used to be.

"At least dead bodies don't lie around on the streets like they used to," said Jerry Funk, a former adviser on Africa in the Carter White House and a regular traveler here.

The disappearance of corpses from the streets typifies the kind of change imposed on Lagos by economic depression and, in the past two years, by stern military rule. It is not that Lagos is rebuilding, but that it has stopped killing itself.

Policies of the military government, which remain in place despite a coup in August, have forced the cleanup of mountains of garbage, filling of potholes, removal of thousands of wrecked cars from freeways.

Traffic jams last for hours, not entire days as in the mid-1970s. Longtime residents say far fewer people excrete in public than before. Reports of robbery are down, and police no longer shake down commuters at freeway roadblocks.

Electricity outages have declined in many parts of Lagos, from 15 to 16 hours a day in 1983 to three or four brief blackouts a week. Telephone service, while still halting, has improved. Ship piracy in Lagos harbor, a chronic problem in the 1970s, is down sharply.

"What all this betokens is the calm of stagnation," observed Herbert D. Gelber, deputy chief of mission at the U.S. Embassy here. According to Gelber, there is an inverse relationship between the economic vibrancy of Lagos and its livability. In other words, the bigger the boom, the greater the collective urban suffering.

The recent history of Lagos bears him out. Lagos became internationally renowned for being unpleasant about a decade ago. By then, millions of Nigerians, lured by the oil billions that washed over Lagos in the 1970s, had crowded into this former fishing village from across the countryside of Africa's most populous nation.

There were thousands who made instant fortunes, who became ogas, or big men. They celebrated themselves and their money with Mercedes-Benz automobiles, foreign travel and solid gold bathtubs. More and more money mixed in the swamp heat here with more and more ambitious Nigerians to brew a nightmarish stew of inefficiency, corruption, frustration and crime.

The Lagos skyline is bedizened with high-rise artifacts of those money-intoxicated years. The grandest of these is the 37-story External Telecommunications building, which was gutted by fire in 1983. Arsonists are suspected of having torched the building to destroy evidence of close to $80 million in unpaid telephone and telex bills. The tallest building in Nigeria now stands charred and empty.

The oil glut of the 1980s, which cut demand for and prices of Nigerian crude, sobered up Lagos.

Nigeria is now failing to pay its debts to the world merchants whose ships once clogged Lagos harbor. The flow of legal imports has slowed to a trickle. There were massive layoffs of government workers. By some estimates, half the city's work force is unemployed. Plans for a $1 billion subway system were scrapped.

While it is still growing at a rate that will double its population by the year 2000, some people have abandoned the city to return to up-country farms. The World Bank says this exodus is partly responsible for the 25 percent increase this year in cultivated land in Nigeria.

And yet there is still an energy, a mixture of ambition, avarice and dread, that makes life in Lagos different. Comparing Lagos to other African cities, such as Nairobi, Lusaka or Addis Ababa, is like comparing New York to Dayton.

Kazeem Adelakun, 29, a plumber by day and cabbie by night, is angry over the retrenchment of Lagos. His earnings from the plumbing business, he says, are down from about $750 a week to about $150. He says he used to make $150 a night driving a taxi; now he is lucky to make that much a week. His 18-hour workdays support his wife and son and help support his five brothers, a sister, his mother and grandmother.

But Adelakun cannot afford to replace the videotape recorder stolen last year from his bedroom.

A tall, thin Moslem who wears a baseball cap pulled low over his eyes and smokes European cigarettes, Adelakun lives with his wife and child in a five-room, concrete-block house that he shares with eight other family members. The walls of the house are blackened with kerosene soot. The kitchen in the back has no stove; food is cooked over a small fire pit. The bathroom is a shack built on stilts over a nearby sea-water lagoon.

By Lagos standards, it is a middle-class living arrangement. Nigeria's National Population Bureau estimates that, on average, there are about 35 persons in every residential structure in the city, about six persons per room.

Adelakun, who has a refrigerator and a stereo in his bedroom, acknowledges his family's relative affluence. "My family is the second richest in the village," he said.

The village is a seven-year-old squatters' settlement on the beach of Victoria Island, one of the affluent parts of Lagos. About 900 families live there in tin-roof houses packed together along narrow alleys of sand. The village is not connected to the city's power, telephone or water systems.

Adelakun makes electricity with his diesel generator behind his house and sells it -- charging about $5 a day -- to 27 neighbors. "We make a lot of money," he explained.

J.K. Randle is both a native son and a student of Lagos. His father was a wealthy businessman and so is he. For more than a decade, Randle has been studying what oil money did to his home town.

"The exploitation of oil changed the character of Lagos," Randle said. "Relationships between neighbors became impersonal. You had cowboys and buccaneers who came in from around Nigeria. As they prospered, they went back to their villages to attract more."

World Bank specialists on Lagos believe that the city's roads, sewers, water and electricity could catch up to its population one day.

According to Ishrat Husain, the World Bank representative here, that would require the rebirth of farm profits in Nigeria.

"If there is a real sustained upsurge in agriculture, Nigerians will stop pouring into Lagos and many newcomers may leave. They will go where the money is, and you may find some reduction in pressures on the city," Husain said.

Randle, however, doubts that large numbers of Nigerians in Lagos will return to farm work.

"Most people here don't believe the opportunities have disappeared," he said. "They believe a certain elite holds the power and it is only a matter of getting access to the right deals."