The antagonistic messaging President Trump has delivered to Ukraine since taking office has presented leaders in Kyiv with a brutal reckoning: that the United States can no longer be counted on as a supporter, and may even be an adversary, in the effort to end the war with Russia.

In the past two weeks, Mr. Trump has initiated direct peace talks with Russia and dismissed Ukraine’s protests that it should have a seat at the negotiating table. He has called Ukraine’s president, Volodymyr Zelensky, a “dictator” and falsely claimed that Ukraine was responsible for the war that Russia started with its 2022 invasion.

As the war enters its fourth year, that enmity has prompted Kyiv to reassess what leverage, if any, it still holds over America’s policy in Ukraine and to explore alternative options to safeguard its interests.

There are few of them, and none are ideal, analysts and Ukrainian officials say. Ukraine can curry favor with Mr. Trump by dangling lucrative economic deals, such as the minerals agreement currently under negotiation, but at the risk of facing onerous terms in return.

If American support dries up, Kyiv could hold out on the battlefield as long as it can — which could be only a few months — hoping Mr. Trump acknowledges that peace talks cannot proceed without its involvement.

In the meantime, Ukraine has made an emphatic pivot toward Europe as its new closest partner and potential security guarantor. In the past few days, Mr. Zelensky has engaged in numerous calls and meetings with his European counterparts to discuss increased military support, including peacekeeping troops on the ground. On Monday, President Emmanuel Macron of France pleaded Ukraine’s case at the White House.

Either way, “Ukraine should not count on U.S. support in negotiations,” Volodymyr Fesenko, a Ukrainian political analyst, wrote on Facebook last week — an approach that not long ago would have seemed unimaginable.

For Ukrainians, it is difficult to adapt to this new situation, said Alyona Getmanchuk, the head of New Europe Center, a Kyiv-based think tank, and Mr. Zelensky’s pick to be Ukraine’s next NATO ambassador. “We’ve long been used to having the U.S. on our side, and we still need them fully on our side,” she said in a phone interview.

After Mr. Trump returned to office in January, Ukraine hoped to appeal to his business-oriented mind-set as leverage. It offered a deal on access to critical minerals, which are key to modern technology manufacturing, in exchange for continued American support.

But Mr. Trump flipped the concept on its head, demanding a deal worth $500 billion in Ukraine’s natural resources, including minerals, oil, and gas, without offering anything in return. Mr. Trump has framed access to Ukraine’s resources as “payback” for Washington’s past aid to Kyiv. The real value of American assistance to Ukraine so far is about $120 billion.

Kyiv has rejected several versions of a deal that it deems too onerous. As of Monday evening, officials on both sides were working on a revised agreement with more favorable terms for Ukraine, and appeared close to a deal.

It remains to be seen whether the deal helps Ukraine in its relationship with the Trump administration. On the one hand, it will allow Mr. Trump to declare that he secured a big financial boon. But ceding revenue from natural resources to the United States could divert money now being used for the war effort, and saddle Ukraine with future debt.

Another factor might work in Ukraine’s favor, experts say: Mr. Trump’s vanity. The American president has boasted that he can quickly end the war, but he cannot do so without Ukraine’s consent. That gives Kyiv at least some leverage.

“Without Ukraine’s approval of a potential deal, Trump won’t be able to be the great peacemaker he claims to be,” Ms. Getmanchuk said. “He would appear as a president unable to deliver on his promise. He needs Zelensky to accomplish this peacekeeping mission.”

Ultimately, experts say it is up to Ukraine to decide whether to continue the fight. The key now is whether it can hold out long enough on the battlefield, potentially cut off from U.S. support, to avoid having to accept a deal with onerous terms.

The Ukrainian government has said that it has enough funds, weapons and ammunition to sustain its fight against Russia through the first half of this year. But structural issues in its army have weakened its defense, including a shortage of soldiers for the front lines, exhaustion after three years of war that has led some to desert, and coordination gaps between brigades that Russian forces routinely exploit.

Still, military analysts say that Ukraine has some elements working in its favor. It has significantly ramped up its domestic weapons production, producing nearly all of the attack drones it deploys on the battlefield — the primary means of targeting Russian troops today.

Ukraine’s defense industry now covers about 40 percent of the country’s need in weapons, according to Solomiia Bobrovska, a member of the Ukrainian Parliament’s defense and intelligence committee.

Nico Lange, a former German Defense Ministry official who is now a senior fellow at the Munich Security Conference, said, “Holding the line and saying, ‘Look, we will continue to defend ourselves,’ is I think what strengthens Ukraine’s position in this unfortunate situation.”

Perhaps the most promising option is Ukraine’s turn to Europe.

Mr. Zelensky said last week that he had started talks with his European counterparts to have them fund Ukraine’s war effort “if the United States decides not to.” Just in the past few days, he has spoken to dozens of European leaders by phone or in person during a large summit held in Kyiv on Monday.

France and Britain have also taken the lead in discussions about deploying European peacekeeping troops to Ukraine as part of a postwar settlement to deter further Russian aggression. Following Mr. Macron’s discussion of the idea with Mr. Trump on Monday, Prime Minister Keir Starmer of Britain is expected to push the proposal during his visit to Washington this week.

Still, Mr. Starmer has acknowledged that deploying European troops would not be viable without what he called a “U.S. backstop” to deter Russia, potentially in the form of American air cover. Many in Ukraine also recall that Europe failed to meet its promise to deliver one million artillery shells by March of last year.

At a security forum in Kyiv last Friday, top representatives from the European Union, NATO and Canada, as well as David H. Petraeus, the retired U.S. general and former C.I.A. director, agreed that Ukraine’s path forward must be multipronged: deepening ties with Europe, increasing domestic weapons production and, in the immediate term, repairing relations with Mr. Trump.

But officials in Kyiv also do not rule out the possibility that the famously mercurial Mr. Trump could suddenly shift and back Ukraine, especially if negotiations with Russia stall.

His flurry of statements in recent days, often delivered late in the day in Ukraine because of the time difference, has been such that Ms. Bobrovska said a new joke was now circulating in Kyiv’s political circles: “Better to fall asleep early than to listen to Trump on Ukraine.”