A federal grand jury here charged yesterday that alleged Washington drug kingpin Linwood Gray bought three houses, a nightclub and five cars with cash and paid as much as $15,000 a trip to heroin couriers from the profits he reaped from an international smuggling operation over the past 2 1/2 years.

In a meticulously detailed, 56-count indictment, the grand jury alleged that Gray masterminded an enormously profitable import scheme in which couriers smuggled extraordinarily high-grade heroin from Amsterdam through Zurich, Montreal and Chicago to the streets of Washington. Sixteen others, including four alleged key lieutenants of Gray, also were charged in connection with the alleged plot.

The indictment, the result of a 1 1/2-year investigation by federal agents, prosecutors and Washington police, lists 141 specific acts that Gray and various people among the 16, in addition to six unindicted coconspirators allegedly performed to carry out the conspiracy to import heroin.

Kenneth Michael Robinson, Gray's attorney, has said that Gray is innocent of all charges. He said last night that three of the unindicted coconspirators -- Joseph W. Sorrell, Rene Clark and Ernest A. Fletcher -- have testified about the case before the grand jury and are expected to be government witnesses.

According to the indictment, there were surreptitious meetings at such D.C. hotels as the Capital Hilton and Washington Hilton and at Johnny Boy's Carryout in Bradbury Heights at which large sums of cash exchanged hands. It was then that Gray or one of his key aides allegedly gave couriers more money to buy heroin in the Netherlands or paid them for a previous heroin smuggling trip.

"The conspiracy took the form of a loose-knit business organization, with members of the conspiracy performing different functions and operating at different levels of responsibility," the indictment alleged.

Responsibilities in the scheme even were delegated to the extent that some Gray lieutenants allegedly had the task of retaining lawyers for people accused in the plot, the indictment charged.

Six of the 17 accused in the indictment have not been arrested, according to Assistant U.S. Attorney Barry L. Leibowitz, the prosecutor who headed the probe. Most of the rest were arrested in raids on Jan. 23.

Leibowitz was shot in the federal courthouse parking lot on Dec. 20, an attack that law enforcement sources said they presume was related to the drug investigation. But Leibowitz was not hurt seriously and resumed work on the case shortly after the shooting.

In all, sources close to the investigation have said that the alleged ring brought at least 100 pounds of near-pure heroin worth $30 million to Washington. But the indictment mentions much smaller amounts when specific quantities are listed, while the amounts of some heroin shipments are not identified specifically.

Gray, a muscular, 34-year-old former mental patient who frequently has tangled with police and other authorities as he wound his way through the D.C. judicial system in the last 12 years, was named in all but five of the 56 counts in the 47-page indictment.

All 17 are charged with engaging in the alleged conspiracy to import heroin. All 17 also are charged variously with illegally importing heroin, possessing heroin, engaging in interstate and foreign commerce to import heroin, and passport violations.

In addition, Gray and three of his alleged key aides -- Carl L. Cathey Jr., Joseph F. Wilson and Robert L. Stuckey -- are charged with engaging in a "continuing criminal enterprise," which the grand jury said netted them "substantial income and resources."

The indictment charged that Gray bought a house in Oxon Hill and two in Morningside in Prince George's County with the proceeds of the alleged drug operation and at one point paid $25,000 in cash for improvements on one of the dwellings. The grand jury also alleged that Gray concealed the true ownership of the properties by putting the titles of the homes in other people's names.

In addition, the indictment alleged that Gray, with Wilson, bought the Camelot Club at 3859 Alabama Ave. SE, and used it as a rendezvous for a drug operation. The club recently burned and investigators have said that the fire was set.

Gray also had $58,750 in cash held under two other names at the National Bank of Washington and bought a Cadillac, a Corvette, a Dodge van, a Ford and a Camaro with cash from the drug scheme, the indictment alleged.

All of this property, as well as three cars Cathey allegedly bought with drug sale proceeds, and two cars and a house that Stuckey allegedly bought, would be forfeited to the government if the four are convicted.

The indictment charged that Cathey, Wilson, Stuckey and Robert W. (Dirty Bob) Young Sr. were Gray's most important allies in the alleged scheme. The indictment said that George F. Carter III, Gary P. Carter, Alton B. Nelson Sr., Smith D. Hammond and Elfriede Helena Anna Visser and the six unindicted coconspirators ferried the heroin to the United States and that the others charged carried out other functions in the alleged plot.

Gray also is charged with two counts of mail fraud and filing two false declarations about his federal income tax returns.

According to the indictment, Gray filed last June a 1976 tax return in which he claimed that he had earned $4,320 that year and owed $93 in taxes. At the same time, he allegedly filed a 1977 return, claiming that he earned $11,910 two years ago and owed $1,367 in taxes. He allegedly later filed declarations with the Internal Revenue Service swearing that the returns were correct when he knew they were not, according to the indictment.