But after Mr. Yanukovych fled Ukraine in February, Mr. Miller announced that the price would revert to $385 per unit on April 1. Mr. Miller said Ukraine’s unpaid debt to Gazprom — and not any political motivation, like punishing and further destabilizing the European-minded interim government in Kiev — prompted the move.

Then the price went up again.

Under a 2010 accord between Mr. Yanukovych and Moscow, Ukraine received a 30 percent discount on gas in return for extending Russia’s lease on its base in Crimea for the Black Sea fleet. But after Russia’s annexation of Crimea, Moscow abrogated the accord, canceling the reduction and bringing the price Ukraine now pays Gazprom to $485 per unit.

Gazprom added that it intended to apply this price retroactively to 2010 when the deal was struck.

That’s not all.

Mr. Medvedev, Gazprom’s No. 2 official, insisted that Ukraine owed an additional $18.5 billion (mostly for gas never used). This figure stems from a January 2009 contract that the prime minister at the time, Yulia V. Tymoshenko, signed after Russia cut off gas to Ukraine, again over unpaid debts (then some $2.4 billion). In early 2009, after more than two weeks without gas, Ukraine and East European countries like Slovakia, which then got all its gas through Ukraine, were freezing.

The agreement eliminated a shadowy intermediary company, but committed Ukraine to a 10-year deal at a high level of consumption — some 50 billion cubic meters a year — and at a price higher than what the rest of Europe was paying. But Ukraine’s gas consumption declined from 44 billion cubic meters in 2011 to 32 billion in 2012 and some 28 billion last year, given the recession, said Dmitri Petrov, an analyst of emerging markets at Nomura. Gazprom insists it should be paid for the difference.

In January, Gazprom demanded the additional $7.1 billion under the contract as payment for unused gas for 2012, but Ukraine refused to pay it, and it is considered unlikely to be enforced in any court outside Russia itself. Now Gazprom has billed Ukraine for an additional $11.4 billion for unused gas in 2013 under the same contract, including the retroactive pricing after 2010 that represents the return of prepayment on the base lease.

Image The chief executive of Gazprom, Alexei B. Miller. Credit... Yuri Kochetkov/European Pressphoto Agency

That would bring the total Gazprom says it is owed to at least $22 billion by the end of May.

Whether Gazprom actually expects to get that extra money is debatable. A Czech unit of Germany’s RWE A.G. won a legal ruling in 2012 on a similar complaint, supporting its refusal to pay for gas it did not use.