President Carter unveiled yesterday a new anti-inflation program that he said would restore "discipline" to both government and American consumers, partly by putting the federal budget in the black for the first time in 12 years.

The plan involves $13 billion in proposed new cuts in federal spending next fiscal year, an oil-import fee that will boost gasoline prices 10 cents a gallon, potentially stiff new limits on consumer and business credit and stepped-up government wage-price monitoring.

Carter also ordered immediate restrictions on all federal hiring, with job ceilings designed to eliminate 20,000 federal job slots by the end of the fiscal year. And he proposed computing cost-of-living increases in benefits for federal retirees once a year instead of twice.

The president also asked Congress to pass legislation that would require banks and corporations to withhold and send on to the treasury taxes on the interest and dividends they pay. This would bring in $3 billion in new revenues. Interests and dividends now are not subject to withholding.

The Federal Reserve Board announced separately it will move to curtail business borrowing by placing new voluntary limits on increases in bank lending.

To restrict the amount of money a bank has to lend, the Fed also said it would add 3 percentage points to the interest rate charged large banks if they seek new loans from the Fed two weeks in a row. The rate is now 13 percent.

The Fed also ordered banks and other lenders to restrict some types of consumer credit, including credit cards, check overdraft coverage and personal loans not secured by collateral. Loans for autos, homes and appliances will not be affected.

Carter said the combination of proposals, most of which must be approved by Congress, would eliminate the $15.8 billion budget deficit he proposed last January and leave a $10 billion to $13 billion surplus -- the first since 1969.

The president did not list most of his proposed budget cuts, but he did say he would propose elimination of the states' portion of revenue sharing. He will also propose significant cuts in public job programs and is asking Congress to defer the welfare "reforms" he sent up last year.

As officials had hinted earlier, Carter did not propose any cuts in defense spending. Officials said at a briefing that the White House would be "looking hard at economies," but also maintained that Carter remains committed to a defense increase of 3 percent over inflation.

The president said in announcing his program in an East Room ceremony that "cutting back federal spending to match revenue is not a cure-all -- but it is an essential first step" in fighting inflation.

However, both Carter and his economic advisers warned that immediate improvement is not likely, and that the inflation figures would continue to be high in the months ahead.

The president denied in a later news conference that his budget cuts would fall unfairly on the poor. He said "the best thing I can do for them, they "are the ones who are most poor" is to combat inflation because damaged by it."

The White House is forecasting an 11 3/4 percent increase in consumer prices during 1980, compared to 10.4 percent predicted in the January budget document, and is saying consumer price inflation will return "to a high single-digit rate" in 1981.

At the same time, officials projected that the proposed spending cuts and higher gasoline prices would produce a longer, albeit milder, recession than earlier expected. The jobless rate is expected to climb to 7.4 percent by year-end, from 6 percent now.

Carter's multipronged effort is intended first to demonstrate by the budget cuts and import fee that the government is serious about fighting inflation, and second to soak up consumer and business purchasing power and put some slack in the economy.

Carter told about 200 congressional leaders and other notables assembled for the announcement that the current inflation threat is a dangerous situation that calls for urgent measures.

"Our whole society -- the entire American family -- must try even harder to live within its means," he said. "We must begin to spend money according to what we can afford in the long run -- not according to what we can borrow in the short run."

Because of lags in refining, the 10-cent-a-gallon rise in gasoline prices, which will result automatically from the import fee that Carter imposed yesterday, is not expected to show up at the pump until May 15.

The import fee is intended as an interim step until Congress enacts a 10-cent-a-gallon increase in the federal gasoline tax that Carter said he will request. The feel will be removed when the tax is in place.

The import fee and tax-withholding proposal for bank interest and dividends will bring to $52 billion the increase in federal tax burdens that Americans will bear this year under Carter's budget plan.

The figure includes the impact of inflation in pushing taxpayers into higher income-tax brackets, the scheduled Jan. 1 increase in Social Security taxes and the effect of the new tax on crude oil pending before Congress.

Because of the inflation problem, Carter and his advisers have decided against proposing a major tax cut, as is traditional in an election year. However, officials hinted he may propose tax incentives for investment next year.

Although he is cutting or deferring most of his other new spending proposals, the president said he would continue to press for a new youth unemployment program he announced in January. The plan involves $150 million in fiscal 1981.

The president's announcement yesterday climaxed a 3 1/2-week policy review by Carter and his advisers, begun after news of a burgeoning budget deficit and worsening inflation left the bond market near collapse. Inflation the last two months has ben running at an annual rate of 18 to 20 percent.

The White House yesterday blamed misinterpretation of its January budget by Wall Street for fomenting the current crisis, charging that the financial community had perceived the spending plan wrongly as backing away from fiscal restraint.

However, officials conceded "there are real causes for concern" and said "strong and decisive action is necessary to turn the tide around. We cannot let a continued worsening in inflationary expectations . . . undermine a basically sound economy."

For all the drama of Carter's announcement yesterday, there was no guarantee that he would be able to push through his cuts and revenue-raising ideas. Most require approval of Congress, and the lawmakers previously have rejected the bulk of them by wide margins.

The administration has sought to smooth the way for congressional approval by conducting marathon negotiations with key House and Senate leaders in an effort to build a consensus.

Officials said yesterday, however, that even if Congress refuses all the proposed cuts, the budget still would be nearly balanced by the imposition of the oil-import fee, which would bring in $11 billion in new revenues.

Officials said the import fee was intended partly as "a cusion" to bolster the credibility of the administration's balance-the-budget pledge. "We don't want anybody to be able to say it's not credible," one policymaker said.

Carter also served notice he intends to enforce his budget austerity plan by regularly vetoing legislation that exceeds the budget. And, if that does not work, he said he will ask Congress for temporary impounding powers.

The proposal involving withholding of taxes on interest and dividends would raise revenues by $3 billion, partly through a one-time speedup in tax collections and partly by nabbing tax evaders who escape payment altogether.

The plan would not affect a provision in the pending crude-oil tax bill that would allow single taxpayers to avoid taxes on the first $200 in interest and dividends, $400 for couples.

The restrictions on federal hiring would limit federal agencies indefinitely to fillling only half the full-time permanent job slots that become vacant after last Feb. 29.

Agencies may fill vacancies that existed before Feb. 29, but those hirings willl be charged to the department's overall limit. The restrictions are expected to result in a reduction of 6,500 full-time positions each month.

The documents the White House distributed yesterday listed six specific proposals for reductions in fiscal 1981 spending:

$1.7 billion by eliminating the states' portion of the federal revenue-sharing program.

$859 million by postponing the president's welfare reform plan.

$267 million by deferring the mass transit grants provided for in Carter's July energy program.

$212 million by cutting regional economic development grants.

$76 million in Department of Housing and Urban Development solar and conservation bank payments.

$22 million in Interior Department matching grants for the current territorial tax.

Carter said he would send Congress within a month a revised budget plan listing other proposed spending cuts. Among examples he cited yesterday were public job monies, urban parks grants and money for waste-treatment plant construction.

Carter also proposed $4 billion in reductions in federal loans and loan guarantees for fiscal 1981 and $2 billion in spending cuts for fiscal 1980, both gestures to help relieve the worried bond markets.

With yesterday's revisions, the budget now calls for total spending of $611 billion to $613 billion in fiscal 1981, not much changed from the $615.8 billion proposed in January. The fiscal 1980 deficit is $36 billion to $31 billion.

The $4.62-a-barrel oil-import fee was intended partly as a move to spur energy conservation. Officials estimated that imposition of the fee and the resulting higher gasoline prices would trim oil consumption by 100,000 barrels a day.

Carter also set a new voluntary national tareget for gasoline consumption this year of 6.65 million barrels a day, down from 7.03 million barrels a day in 1979 and 6.86 million barrels a day predicted previously for 1980.

And he repeated an earlier warning that he will impose mandatory ceilings on gasoline consumption in any state where the voluntary targets are not met. The higher gasoline prices will boost consumer prices by 0.5 percent.

The program outlined yesterday also includes some tightening of the wage-price guidelines program -- mainly by imposing stiffer reporting requirement, including asking some firms to notify the government before raising prices.

Carter also said he would beef up the staff of the Council on Wage and Price Stability, effectively doubling its 233-member staff to help keep tabs on wage and price increases.

Carter also rejected, as he has in the past, the use of wage-price controls, calling them unworkable. Carter has no legislative authority to impose controls, which have been recomended by his rival for the Democratic presidentrial nomination, Sen. Edward M. Kennedy (D-Mass.).