The Carter administration yesterday rejected an appeal from Somalia for weapons and troops to repel what that country said was a planned invasion by Soviet-backed Ethiopian forces.

As the war of words escalated to a higher pitch than the fighting in the Horn of Africa, a State Department spokesman said: "We will not contribute to a conflict . . . by pouring gasoline on it."

Somali President Siad Barre made the plea for military help Monday when he called in the heads of missions from the United States, Britain, France, West Germany and Italy.

U.S. officials said there had been similar private requests in the past, and they reiterated American opposition to military involvment in the conflict and called again for negotiations. The United States has criticized the Soviet Union for supplying Ethiopia with large amounts of military material in its war against Somali-backed rebels in Ehtiophia's Ogaden region.

Ethiopia yesterday denounced as "a baseless lie the Mogadishu [Somali] allegation that the combined forces of Ethiopia, Cuba and the Soviet Union are poised to invade Somalia."

The Soviet news agency, Tass, labeled the accusation "a fabrication from beginning to end" by Somalia, in order "to secure bigger arms deliveries for expanding the aggression" it is committing against Ethiophia.

On the second battlefront in Ethiopia, in the province of Eritrea, the Popular Front for the Liberation of Eritrea charged that "two Russian destroyers" and Soviet Mig fighter-bombers had joined the battle for the Red Sea port of Massawa, attacking rebel strongholds. American officials said they had no confirmation that Soviet warships had entered the fighting.

Ethiopia's ambassador in Washington, Ayalew Mandefro, until recently his nation's defense minister, protested yesterday that the United States is "ignoring the aggression" by Somalia, and airing one-sided versions of the Ethiopian-Somali conflict.

Mandefro said in a telephone interview that he carried his nation's complaint to the State Department Monday that President Carter has failed to say "that aggression is wrong." "Is the United States going to ignore this principle?" Mandefro asked.

The United States has been relatively silent about Somalia's military action across the Ethiopian border in the Ogaden which is inhabited primarily by thnic Somalis. Somalia claims that the fighting which has been taking place since last July is being waged by guerrilla forces, and denies its own troops are involved in what it terms a war of liberation.

President Carter made no criticism of Somalia when he reproached the Soviet Union last week for shipping "large quantities of weapons" and "dispatching Cubans" into Ethiopia. Carter said the Soviet Union was engaging in "unwarranted involvement in Africa."

Carter was referring to American estimates that up to 2,000 Cuban and 1,000 Soviet advisers are now in Ethiopia.

The Soviet Union and Ethipia counter-attacked Carter on the ground that he was ignoring what they called the cause of the conflict in the Ogaden region - Somali "aggression" against Ethiopia.

Ethiopia charged over the weekend that Carter's statement was "the product of a coordinated plot hatched during the week with the reactionary king (shah) of Iran and the anti-people ruling class of Saudi Arabia." Iran and Saudi Arabia, strongly anti-Soviet and Mosleum nations like Somalia, are giving arms aid to Somalia.

State Department spokesman John H. Trattner said yesterday that the United States will adhere to its policy of not sending arms - "troops" - to either side. "What we want both sides to do" he said "is to sit down and talk with each other and work out a negotiated solution."

Ethipian Ambassador Mandefro, however, said yesterday that "we cannot negotiate on the Ogaden when the Somalis are still in the Ogaden."

Somalia, he said, has violated the most sensitive principle in the African continent, "acceptance of existing borders."

American officials privately concede that this is the greatest obstacle for shifting the Ethiopian-Somali conflict to the conference table. There is widespread sympathy in Africa, U.S. officials agree, for Ethiopia's claim that is intended to prevent widespread African croos-border and tribal warfare.

This is also a major reason why African nations generally have not joined in outcries against Soviet and Cuban military advisers in Ethiopia, which is ruled b ya Marxist-oriented military government.

Ethiopia's contention is that it has a sovereign right to call in whatever advisers it needs, or to "take any kind of measure to drive out the invading forces of Somalia . . . and to safeguard its territorial integrity and dignity."