Pay-as-you-go and API?

We are looking for a way to use the “pay as you go” option, and use the API,

is there any way of doing this?