Chief Tools Logo
Bill.DO API v1

What the resources of an account cost: current spend, predictions and history.


Get the usage

GET
https://bill.do/api/v1
/accounts/{account}/usage
OpenID Connect
or
Bearer (ctp_*)
or
Bearer (ctt_*)

Calculate the current spend of the account and the predicted spend for today, this month and next month, in USD. Optionally only for a project or some resource types.

Get the usage › path Parameters

account
​integer · required

Get the usage › query Parameters

project
​string | null · maxLength: 64

Only count the usage of this DigitalOcean project UUID. Needs a plan with the project filter.

resource_types[]
​array | null · minItems: 1 · unique

Get the usage › Responses

account_id
​integer · required
project_id
​string · required

The project the usage is limited to, null for the whole account.

resource_types
​array | null · required

The resource types the usage is limited to, null for all types.

hourly
​number · required

Current spend per hour of the resources that exist.

day_to_date
​number · required

Spend so far today.

day_predicted
​number · required

Predicted spend for the whole of today.

month_to_date
​number · required

Spend so far this month.

month_predicted
​number · required

Predicted spend for the whole of this month.

next_month_predicted
​number · required

Predicted spend for next month when the current resources keep running.

calculated_at
​string · required

Get the usage history

GET
https://bill.do/api/v1
/accounts/{account}/usage/history
OpenID Connect
or
Bearer (ctp_*)
or
Bearer (ctt_*)

Get the recorded spend of the account in USD per period of the range, per hour for a day, per day for up to 90 days and per month for longer ranges, split by resource type. Optionally only for a project or some resource types.

Get the usage history › path Parameters

account
​integer · required

Get the usage history › query Parameters

project
​string | null · maxLength: 64

Only count the usage of this DigitalOcean project UUID. Needs a plan with the project filter.

resource_types[]
​array | null · minItems: 1 · unique
range
​

The time range: today and yesterday per hour; past_7_days, past_30_days, past_90_days, month and past_month per day; year, past_year and all per month.

Get the usage history › Responses

range
​string · enum · required
Enum values:
today
yesterday
past_7_days
past_30_days
past_90_days
month
past_month
year
Example: past_30_days
interval
​string · enum · required

The size of each period: hour, day or month.

Enum values:
hour
day
month
from
​string · required
to
​string · required
​array · required

The periods from old to new, periods without recorded usage have zero spend.