A secret agent of the Lockheed Aircraft Corp. in Japan admitted at his trial today that he had received money from Lockheed but denied doing anything to promote sales of the American company's planes.

Yoshio Kodama, 66, long influential in the Japanese underworld, admitted receiving about $45,000 a year between 1958 and 1969, and about $150,000 a year since then.

Kodama denied having been responsible for distribution of some $8 million of a Lockheed slush fund earmarked for Japanese politicans and the executives of a domestic airline.

Former Prime Minister Kakuei Tanaka and 17 other politicans and businessmen have been indicted on charges stemming from the Lockheed bribery and influence-pedding scandal.

"When I signed my contracts with the Lockheed Corporation I thought I was going to be merely an adviser," Kodama said in a statement submitted to the court. "Besides, everything was in English, a language I do not understand."

Kodama's relationship with Lockheed goes back to 1958, when he is said to have reversed a Japanese Defense Agency decision to buy Grumman airplanes. Japan ardered 200 Lockheed F-104 Starfighters in a sudden decision that caused many observers to suggest bribery was involved.

Kodama is charged with having evaded $6.5 million in income taxes between 1972 and 1975 and having obtained $3.6 million in foreign currencies, in violation of Japanese laws.

His court appearance brought out a large number of his followers, many of whom stood in line in the rain to obtain lottery tickets for the draw to determine who could enter the courtroom.

One man practiced karate punches and kicks in view of about 500 specators. Young toughs, wearing oversized back. Prussian-style cadet uniforms (the accepted dress for apprentice hoodlums in the Japanese underworld), waited for the arrival of Kodama's black Lincoln shortly before 10 a.m.

Kodama appeared in court only 40 minutes. He testified that he was still under the effect of the stroke he suffered in February, 1976, just after the scandal broke.

In today's afternoon session, the prosecution read an 80-page document explaining the charges and suggesting in strong terms that Kodama's pleas of ignorance are part of a conspiracy of silence.

According to the prosecution, when J.W. Clutter, an executive of Lockheed, was summoned to appear before the Senate subcommittee corporations, he phoned Taro Fukuda, Komada's interpreter, to warn of the consequences of the hearing.

The prosecution statement quotes Kodama as saying Feb. 4, 1976 - one day before the Senate's subcommittee's hearings - "Lockheed should pay for its mistakes . . . they should at least pay my taxes."

The prosecution alleged that Kodama was to receive a commission for Lockheed TriStars sold not only to Japan's All-Nixon Airways but to Korean Air Lines, in which Kodama's friend Kenji Osano has shares. Osano, owner of several hotels in Hawaii, is also a friend of Tanaka. Osano is charged with perjury in connection with the Lockheed case.

Kodama allegedly to receive $4 million for sales of the first six TriStars to the Korean line and $120,000 per plane thereafter.

His influence in Japanese politics goes back to before World War II, when he was arrested for threats and attempted assassinations of Cabinet ministers. During the war, Kodama acted as a procurer of supplies, for the air arm of the Japanese imperial navy.

Kodama's men are said to have used opium to pay for supplies. At the end of the war, before he was arrested as a Class A war criminal, he handed over his fortune to the founder of the ruling Liberal Democratic Party. After being released from jail, Kodama is said to have been paid by the CIA to bring out tungsten from China but reportedly never delivered the metal.