In the context of Twitter, think about free analogy being newsgroups (if you are young enough not to have witnessed it, in the early days of Internet, your ISP would provide you with email box with some space attached to it and a newsgroup access). Newsgroups were functionally very similar to what Twitter does, i.e. they were designed to share news between multiple subscribers of those news.
So, newsgroups weren't free in the sense that you had to pay your ISP to access them (not necessarily billed separately though, typically just a part of a package deal). But they were free in the sense that it was a distributed service provided by multiple (and by that I mean, hundreds) of independent providers, and it was an open standard: if you wanted to become a provider of the service, you wouldn't have to invest a lot into that, just set up yet another server with some freely available software and you are good to go. So, if for some reason your ISP wouldn't connect you to the newsgroups, you'd just go to another one who would (it didn't really matter back in the days and the feature didn't have as wide of an outreach as social networks have today, but, in principle, it would've worked that way).
So, this kind of freedom would've offered better protections against single company deciding the fate of the important part of yours.
The problem with building a business around a free API from a for-profit company is the rugpull. As a sibling comment mentions, even a paid API can get rugpulled. But I think that what the OP was trying to contrast a free API from a for-profit company with was actually an API from a non-profit company. A non-profit can run forever if it's just breaking even, and is sharing IP, so other people can jump up and replace it if they fail, and you might even be able to install it on your own servers.
edit: I'm not a big Mastodon booster (or even liker), but if you build your business around it, it would be nuts because the customer base is of course tiny at this point, but you run very little management risk from the Mastodon project itself. Whereas your relationship with twitter can be changed on a day to day basis, unilaterally.
There's not much incentive to jack prices up 10x, it's their revenue, by doing so they will probably lose some. There's incentive though to not offer something for free, as this is literally losing you cash. You never know all the facts though, Google Maps did increase the API cost quite a bit, so it can always happen, but when it's free, you do know some of the facts... and it's not in your favor.
So yes, still some risk, but not at all the same amount of risk.
If there is room to jack up the price 10x, then the current price is tantamount to free. If the deal is too good to be true, don't build your company on it.
Luckily the company I worked for was pretty diversified.