As global demand for Covid-19 vaccines dries up, the program responsible for vaccinating the world’s poor has been urgently negotiating to try to get out of its deals with pharmaceutical companies for shots it no longer needs.

Drug companies have so far declined to refund $1.4 billion in advance payments for now-canceled doses, according to confidential documents obtained by The New York Times.

Gavi, the international immunization organization that bought the shots on behalf of the global Covid vaccination program, Covax, has said little publicly about the costs of canceling the orders. But Gavi financial documents show the organization has been trying to stanch the financial damage. If it cannot strike a more favorable agreement with another company, Johnson & Johnson, it could have to pay still more.

Gavi is a Geneva-based nongovernmental organization that uses funds from donors including the U.S. government and the Bill and Melinda Gates Foundation to provide childhood immunizations to lower-income nations. Early in the pandemic, it was charged with buying Covid vaccinations for the developing world — armed with one of the largest-ever mobilizations of humanitarian funding — and began negotiations with the vaccine makers.

Those negotiations went badly at the outset. The companies initially shut the organization out of the market, prioritizing high-income countries that were able to pay more to lock up the first doses. Gavi eventually reached deals with nine manufacturers.

But the shots did not begin to reach developing countries in significant numbers until mid-2022. By the time Gavi had a steady flow of supply, demand had begun to decline: countries with frail health systems struggled to deliver the shots, and the dominance of the milder Omicron variant sapped people’s motivation to be vaccinated. Now, Covax is winding down far short of its goal of vaccinating 70 percent of the population of each country.

The vaccine makers have brought in more than $13 billion from the shots that have been distributed through Covax. Under the contracts, the companies are not obligated to return the prepayments Gavi gave them to reserve vaccines that were ultimately canceled.

But in light of how many vaccine doses Gavi has had to cancel, some public health experts criticized the companies’ actions.

Covid vaccine manufacturers “have a special responsibility” because their products are a societal good and most were developed with public funding, said Thomas Frieden, the chief executive of the global health nonprofit Resolve to Save Lives and a former director of the United States Centers for Disease Control and Prevention.

“That’s a lot of money that could do a lot of good,” he said.

He added that other large global health programs have budgets roughly equal to the amount the vaccine makers are holding on to. “The entire polio eradication effort costs about $1 billion a year, and that’s a huge infrastructure,” he said.

Gavi has reached settlements with Moderna, the Serum Institute of India and several Chinese manufacturers to cancel unneeded doses, surrendering $700 million in prepayments, the documents show.

Another drug company, Novavax, is refusing to refund another $700 million in advance payments for shots it never delivered.

Gavi and Johnson & Johnson are locked in a bitter dispute over payment for shots that Gavi told the company months ago it would not need, but which the company produced anyway. Johnson & Johnson is now demanding that Gavi pay an additional, undisclosed amount for them.

Gavi had an indirect supply relationship with Pfizer; the Biden administration purchased a billion shots from it to donate through Covax. The United States last year revised its deal with the company, converting an order for 400 million doses into future options. The company said it did not charge any fees to change the order.

The terms of Gavi’s deals were kept secret because they were with private companies. There has been no public accounting of how much drug companies have earned from canceled vaccines.

The documents say that the manufacturers collectively made $13.8 billion in revenue on the vaccines that were distributed through Covax. Almost 1.9 billion doses have now been shipped, to 146 countries. More than half were purchased directly by Gavi and the rest were donated by high-income countries.

Gavi’s settlements with Moderna and Serum took into account that the manufacturers had already incurred costs such as those for raw ingredients, according to the documents.

In a deal to cancel more than 200 million doses reached late last year, Gavi agreed to allow Moderna to keep an advance payment it had made. In exchange, Gavi was released from having to make any additional payments for the doses, meaning they were canceled at a cost “substantially lower” than expected, according to the documents. Moderna also issued Gavi a credit for $58 million for future products, which is good until 2030.

Gavi also made concessions to exit its deal with the Serum Institute of India. Gavi canceled 145 million doses by allowing the company to keep money Gavi had paid in advance, in order to cover the cost of materials that had already been procured. Serum also gave Gavi a credit note of an undisclosed amount that the organization can use to procure the many routine immunizations it buys from Serum each year.

Moderna and Serum declined to comment on the terms.

Gavi and Johnson & Johnson are at odds over 150 million Covid vaccine doses that Gavi ordered but has been trying to cancel for months.

Gavi had been expecting a significant share of those doses to be distributed by the end of 2021, but Johnson & Johnson had delivered fewer than 4 million doses by then. (Gavi’s contract with the company did not require it to finish deliveries by that deadline.) When the company was finally ready to ramp up its deliveries last year, demand had plummeted.

Gavi’s administrators alerted the company by mid-2022 that they would not need those doses and requested that it stop making new shots for Covax, according to the documents.

Johnson & Johnson nevertheless continued to make the shots and sought to deliver them by late 2022, according to the documents. Now, as stipulated in the contract, the company wants Gavi to make additional payment and accept the vaccines.

Gavi has proposed that the dispute go to mediation, but the company has “until now refused to engage in meaningful negotiations,” the documents say. Some of the disputed vaccines have expiration dates as early as mid-2023.

Jake Sargent, a spokesman for Johnson & Johnson, said the company had made the ordered doses available to Covax and kept Gavi informed about production details.

In negotiations with Novavax, Gavi is seeking a refund for $700 million it spent on advance payments for shots.

Gavi had been expecting Novavax deliveries to begin as soon as summer 2021, but the company bungled its vaccine production. As a consequence, Gavi did not proceed with placing the orders for the vaccines it had originally reserved. Novavax said this was a breach of contract and canceled the deal, keeping the $700 million.

The dispute is unresolved. The company is hoping to negotiate a new deal to supply its vaccine to Gavi, said a Novavax spokeswoman, Alison Chartan.

Some of the vaccine contracts that Gavi entered into were completely fulfilled. In one case, AstraZeneca issued Gavi a refund when final production costs were lower than expected.

Had some vaccine manufacturers not been willing to renegotiate their contracts with Gavi, the costs to the organization could have been much higher. Gavi would have been on the hook for $2.3 billion for the doses it wanted to cancel, the documents show, but it saved $1.6 billion by exiting those contracts.

A spokesman for Gavi, Olly Cann, said the organization had made no new payments related to canceled doses. He said the surrendered advance payments represented a fraction of what Gavi would have paid for finished doses.

Dr. Seth Berkley, Gavi’s chief executive, declined to comment for this article. But in an interview in December about the future of the global Covid vaccination program, he said Gavi was paying less per dose than what it had initially planned for vaccine purchases and substantially less than high-income countries paid for their shots.

Donations for Covid shots substantially inflated Gavi’s budget, and the lost prepayments for canceled Covid vaccines do not threaten its regular childhood-vaccination work.

The contracts that Gavi has been trying to downsize were negotiated in the uncertain early months of the pandemic, in some cases before the vaccines had been shown to work.

“In a pandemic, I would want to err on the side of buying too many doses, rather than err on the side of not having enough doses, particularly given the fact that countries felt that there weren’t enough doses at the beginning,” Dr. Berkley said.

Wealthy countries, who ordered many more doses than they needed, have tried to offload their own surpluses onto Covax, which has struggled to absorb them.

Covax began deliveries to developing countries in 2021, but the early pace was glacial. When the program finally had vaccines, the shots presented challenges that weak health systems were ill-equipped to manage.

Frustrated by the erratic supply, some public health agencies did little to create demand for the vaccines, while a tide of misinformation discouraged people from seeking them out. Sub-Saharan Africa remains the world’s least-vaccinated region, but reported Covid death rates in the region have been comparatively low, which has further eroded interest in the shots.

“We have so many offers of donations but we don’t take them, because we don’t want to have them expire here,” said Dr. Andrew Mulwa, who oversees the Covid response at Kenya’s health ministry. “We wonder, do we need to continue to spend money administering Covid-19 vaccines when we have other glaring disparities?”

Gavi is sitting on a stockpile of vaccines and expects millions more in donations from high-income countries that are seeking to shed their own oversupply. The organization anticipates a maximum demand of 450 million doses this year — half of what Covax shipped in 2022.