It depends on the circumstances.
If country XY is feeling vulnerable because a neighbor is clacking their teeth at them then they could just say "yes, come in... set up any where you want and we'll even pay for some of your facilities so you feel welcome".
We get that treatment in a few places.
It could be a situation where the country would like the US there but maybe they want the US to pay for stuff. In those cases we haggle over leasing fees etc. We've done that with the Saudis a few times as an example. Though they go both ways. Sometimes they contribute money to encourage us or to say they've done their part. And other times they want us to pay.
Then there are situations where country XY doesn't feel threatened at all and the US wants to put some facilities there to help with logistics but the locals generally don't give a shit. That requires something from the US.
What we offer in these matters is variable. Sometimes the country just wants us to be there as a deterrent from a rival. Other times the US will offer money or technology or something in return for the facilities.
We don't get bases by pointing a gun at their heads and saying "give us the base or we'll hurt you"... we don't feel good about that. However, we do feel entirely justified in saying "give us the base or we'll abandon you." Many people feel that is just as bad. But we don't see it that way. Denying us basing facilities makes it harder for us to do our job in the area... and if you're not prepared to offer us that then why should we be obligated to do anything for you? See?
So anyway... Americans are very good at making deals. This is gainsaid by people that don't grasp that making deals is a high art in and of itself and we are masters of it. And in that vein we have little trouble getting basing facilities anywhere in the world... often as not we get them in exchange for things that don't appear to cost us much if anything.
Look at all the countries bragging about how little they spend on their militaries... they get away with that because the US is their military. The people that then suggest the US should cut itself to those levels are really just confessing to be morons. Its always sort of funny... and sad.