I'm a happy customer of voip.ms, it costs me less than $1 per month for a US number. Their service has been very stable. They support REST API access and webhooks.
Does this work for 2-factor phone number authentication? Most such systems get flagged as VoIP and blocked or fail silently.
It works roughly 3/4th of the time for me. I've heard that you can increase your chances by buying a 'real' prepaid phone number on eBay for $10 or so, and then porting it over to a VoIP provider.