The DigitalOcean API lets you manage DigitalOcean resources programmatically using conventional HTTP requests. All the functionality available in the DigitalOcean Control Panel is also available through the API.
You can use the API to return your balance, list invoices, and retrieve other billing information.
doctl is a command-line interface for the DigitalOcean API and supports many of the same actions.
doctl supports retrieving billing information from the command line. See the