fbpx
GEThttps://api.spotinst.io/functions/billing?accountId={ACCOUNT_ID}&functionId={FUNC_ID}&fromDate={FROM_DATE}&toDate={TO_DATE}

Get billing usages and costs for function.

Parameter Type Description
ACCOUNT_ID String

The account ID.

Example: act-12345
FUNC_ID * String

The function ID.

Example: fx-12345
FROM_DATE * Integer

Timestamp in milliseconds for the start time.

Example: 1511370488000
TO_DATE * Integer

Timestamp in milliseconds for the end time.

Example: 1511370488000
Request

Headers
{
  	"Content-Type": "application/json",
    "Authorization": "Bearer ${TOKEN}"
}
Response - 200

Headers
{
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "count": "1",
  "items": [
    {
      "functionId": "fx-123456",
      "billing": [
        {
          "category": "DURATION",
          "usage": {
            "value": 1000000,
            "unit": "second"
          },
          "costs": {
            "total": 0.15625
          }
        },
        {
          "category": "INVOCATIONS_COUNT",
          "usage": {
            "value": 2000000,
            "unit": "count"
          },
          "costs": {
            "total": 0.2
          }
        },
        {
          "category": "NETWORK_OUT",
          "usage": {
            "value": 2500.5,
            "unit": "gigabyte"
          },
          "costs": {
            "total": 25.005
          }
        }
      ]
    }
  ]
}