SAN DIEGO (AP) _ An 18-month investigation by a special drug task force has cracked a smuggling ring responsible for bringing as much as 30,800 pounds of cocaine into the United States each year, authorities say.

Two Peruvian nationals who allegedly headed the cartel were taken into federal custody. They were among 81 people named in federal complaints and in a 291-page indictment unsealed Monday.

Diogenes Galanos, special agent in charge of the Drug Enforcement Administration unit in San Diego, said the cartel was believed to be responsible for 20 to 25 percent of the cocaine being smuggled into the United States from all of South America. But Gary Penrith, special agent in charge of the FBI in San Diego, later said the cartel is responsible for 20 to 25 percent of the cocaine being smuggled from Peru.

The investigation was conducted by the Organized Crime Drug Enforcement Task Force, a special inter-agency group set up by President Reagan in 1982.

The indictment alleged the cartel had outlets for distribution throughout the United States, including San Diego; Los Angeles; San Francisco; Dallas; Miami; Sun Valley, Idaho; Portland, Ore.; New York City; Atlanta; Hawaii and Agana, Guam.

The indictment alleged that Augustin Fernando Maurtua, 26, a Peruvian living in Carlsbad, headed the West Coast distribution network of the operation from northern San Diego County. He was being held without bail pending a custody hearing today.

The indictment also alleged that another Peruvian, Jose Antonio Ledgard, 27, was responsible for East Coast distribution from Miami, where he was arrested last Thursday. He also was being held without bail.

''These people were the highest echelon of the cocaine market in South America and Peru,'' said U.S. Attorney Peter Nunez.

He declined to discuss how the cocaine entered the United States or at what geographic points.

DEA spokesman Stan Furce said that in 1983, between 50 and 61 metric tons of cocaine entered the United States. Based on that figure, the operation allegedly run by Maurtua and Ledgard was responsible for 12 to 14 metric tons, Furce said. A metric ton is 2,200 pounds.

In San Diego, Michael Jay Sullivan of Del Mar and Frank Len Jackson of Encinitas were named by Nunez as major distributors of the cocaine.

Maurtua, Ledgard, Sullivan and Jackson are being charged under the Continuing Criminal Enterprise statute, which on conviction could mean a minimum of 10 years in prison and forfeiture of all assets derived from drug proceeds.

Nunez said a federal grand jury Thursday will hear evidence against 20 more people, many of them purchasers of the cocaine.