From my research into this topic, it appears that this claim is pretty much true. For a long time since the war in Iran started at the end of February of this year, the Pentagon has not been very forthcoming on how much they were spending on this war. In a briefing with Congress in March, Pentagon officials including Defense Secretary Pete Hegseth estimated that the first week of war cost the U.S. $11.3 billion. It has only continued to go up exponentially as time has passed. Some recent news articles place spending closer to $50 billion. It is hard to get a true estimate currently because many of these articles reporting on this matter have been posted almost two months past the writing of this. At the start of this conflict, a professor of mine who is an expert in international relations showed our class a tracking website that is currently tracking the cost of the war in Iran. The website places spending at almost $95 billion. I was a little skeptical of this source at first because there is no published authors but the website links all of their sources on the website, so this information is public knowledge and this website just complies it all. So, it is a little difficult to understand the true spending of the Pentagon in this war. I don't think we will know truly how much has been spent until this war has ended. However, the minimum spent by the United States government in this war is $29 billion.
Iran Cost Tracker
Iran war's true cost closer to $50 billion, not $25 billion, U.S. officials say
$25bn or $1 trillion: How much has Iran war really cost the US?