Searching...

Cost Management

Endpoints for managing and optimizing cloud costs including retrieving cost overviews and detailed cost information.

get /costs/{resourceId}

Get resource costs

Retrieve cost data for a specific resource.

cost_type string

The type of cost to retrieve (e.g., compute, storage, network, total)

Enum
  • compute
  • storage
  • network
  • total
start_date string

The start date for the cost query in YYYY-MM-DD format

Format
date
end_date string

The end date for the cost query in YYYY-MM-DD format

Format
date
granularity string

The granularity of the cost data (e.g., daily, monthly)

Enum
  • daily
  • monthly
resourceId string required

The unique identifier of the resource

Responses

Cost data retrieved successfully

Response body Headers
resource_id string

The unique identifier of the resource

costs array

This response does not contain any headers

Resource not found

Response body Headers

This response is empty

This response does not contain any headers

Response examples

Cost data retrieved successfully

{
  "resource_id": "resource_123",
  "costs": [
    {
      "date": "2023-05-01",
      "cost_type": "compute",
      "amount": 15.0
    },
    {
      "date": "2023-05-01",
      "cost_type": "storage",
      "amount": 5.0
    },
    {
      "date": "2023-05-01",
      "cost_type": "network",
      "amount": 2.5
    },
    {
      "date": "2023-05-02",
      "cost_type": "compute",
      "amount": 16.0
    },
    {
      "date": "2023-05-02",
      "cost_type": "storage",
      "amount": 5.5
    },
    {
      "date": "2023-05-02",
      "cost_type": "network",
      "amount": 3.0
    }
  ]
}
get /costs

Get all costs

Retrieve a summary of all costs across resources and services.

start_date string

The start date for the cost query in YYYY-MM-DD format

Format
date
end_date string

The end date for the cost query in YYYY-MM-DD format

Format
date
granularity string

The granularity of the cost data (e.g., daily, monthly)

Enum
  • daily
  • monthly

Responses

Summary of costs retrieved successfully

Response body Headers
total_cost number

The total cost for the specified period

costs_by_resource array

This response does not contain any headers

Invalid input

Response body Headers

This response is empty

This response does not contain any headers

Response examples

Summary of costs retrieved successfully

{
  "total_cost": 5000.0,
  "costs_by_resource": [
    {
      "resource_id": "resource_123",
      "resource_name": "VM Instance A",
      "total_cost": 1500.0,
      "cost_breakdown": [
        {
          "date": "2023-05-01",
          "cost_type": "compute",
          "amount": 50.0
        },
        {
          "date": "2023-05-01",
          "cost_type": "storage",
          "amount": 20.0
        },
        {
          "date": "2023-05-02",
          "cost_type": "compute",
          "amount": 55.0
        },
        {
          "date": "2023-05-02",
          "cost_type": "storage",
          "amount": 22.0
        }
      ]
    },
    {
      "resource_id": "resource_456",
      "resource_name": "Database Instance B",
      "total_cost": 3500.0,
      "cost_breakdown": [
        {
          "date": "2023-05-01",
          "cost_type": "storage",
          "amount": 200.0
        },
        {
          "date": "2023-05-01",
          "cost_type": "network",
          "amount": 100.0
        },
        {
          "date": "2023-05-02",
          "cost_type": "storage",
          "amount": 210.0
        },
        {
          "date": "2023-05-02",
          "cost_type": "network",
          "amount": 110.0
        }
      ]
    }
  ]
}
get /budgets

List all budgets

Retrieve a list of all budgets for managing and tracking cloud expenses.

start_date string

Filter budgets created after this date in YYYY-MM-DD format

Format
date
end_date string

Filter budgets created before this date in YYYY-MM-DD format

Format
date

Responses

List of budgets retrieved successfully

Response body Headers

This response does not contain any headers

Invalid input

Response body Headers

This response is empty

This response does not contain any headers

Response examples

List of budgets retrieved successfully

[
  {
    "id": "budget_123",
    "name": "Production Budget",
    "description": "Budget for production environment",
    "amount": 5000.0,
    "start_date": "2023-06-01",
    "end_date": "2023-12-31",
    "notifications": [
      {
        "threshold": 80.0,
        "email": "admin@example.com"
      },
      {
        "threshold": 100.0,
        "email": "alerts@example.com"
      }
    ],
    "created_at": "2023-05-18T12:34:56Z",
    "updated_at": "2023-05-18T12:34:56Z"
  },
  {
    "id": "budget_456",
    "name": "Development Budget",
    "description": "Budget for development environment",
    "amount": 3000.0,
    "start_date": "2023-07-01",
    "end_date": "2023-12-31",
    "notifications": [
      {
        "threshold": 75.0,
        "email": "dev@example.com"
      },
      {
        "threshold": 90.0,
        "email": "dev-alerts@example.com"
      }
    ],
    "created_at": "2023-06-01T12:34:56Z",
    "updated_at": "2023-06-01T12:34:56Z"
  }
]
post /budgets

Create a new budget

Create a new budget for managing and tracking cloud expenses.

name string required

The name of the budget

description string

A brief description of the budget

amount number required

The total amount allocated for the budget

start_date string required

The start date for the budget in YYYY-MM-DD format

Format
date
end_date string required

The end date for the budget in YYYY-MM-DD format

Format
date
notifications array

Responses

Budget created successfully

Response body Headers
id string

The unique identifier for the new budget

name string

The name of the budget

description string

The description of the budget

amount number

The total amount allocated for the budget

start_date string

The start date for the budget

Format
date
end_date string

The end date for the budget

Format
date
notifications array
created_at string

The date and time when the budget was created

Format
date-time
updated_at string

The date and time when the budget was last updated

Format
date-time

This response does not contain any headers

Invalid input

Response body Headers

This response is empty

This response does not contain any headers

Request examples

{
  "name": "Production Budget",
  "description": "Budget for production environment",
  "amount": 5000.0,
  "start_date": "2023-06-01",
  "end_date": "2023-12-31",
  "notifications": [
    {
      "threshold": 80.0,
      "email": "admin@example.com"
    },
    {
      "threshold": 100.0,
      "email": "alerts@example.com"
    }
  ]
}

Response examples

Budget created successfully

{
  "id": "budget_123",
  "name": "Production Budget",
  "description": "Budget for production environment",
  "amount": 5000.0,
  "start_date": "2023-06-01",
  "end_date": "2023-12-31",
  "notifications": [
    {
      "threshold": 80.0,
      "email": "admin@example.com"
    },
    {
      "threshold": 100.0,
      "email": "alerts@example.com"
    }
  ],
  "created_at": "2023-05-18T12:34:56Z",
  "updated_at": "2023-05-18T12:34:56Z"
}
delete /budgets/{id}

Delete budget

Delete an existing budget by its identifier.

id string required

The unique identifier of the budget

Responses

Budget deleted successfully

Response body Headers

This response is empty

This response does not contain any headers

Budget not found

Response body Headers

This response is empty

This response does not contain any headers

Response examples

get /cost-optimization/recommendations

Get cost optimization recommendations

Retrieve recommendations for optimizing cloud costs.

resource_id string

Filter recommendations by the unique identifier of the resource

start_date string

The start date for the recommendations in YYYY-MM-DD format

Format
date
end_date string

The end date for the recommendations in YYYY-MM-DD format

Format
date

Responses

Recommendations retrieved successfully

Response body Headers

This response does not contain any headers

Invalid input

Response body Headers

This response is empty

This response does not contain any headers

Response examples

Recommendations retrieved successfully

[
  {
    "id": "rec_123",
    "resource_id": "resource_123",
    "recommendation_type": "rightsizing",
    "description": "Resize instance to a smaller type to save costs.",
    "potential_savings": 50.0,
    "start_date": "2023-05-01",
    "end_date": "2023-05-31"
  },
  {
    "id": "rec_456",
    "resource_id": "resource_456",
    "recommendation_type": "reserved instances",
    "description": "Purchase reserved instances for consistent workloads.",
    "potential_savings": 200.0,
    "start_date": "2023-06-01",
    "end_date": "2023-12-31"
  }
]
get /budgets/{id}/cost-history

Get cost history for a budget

Retrieve the cost history of a specific budget.

start_date string

Filter cost history starting from this date in YYYY-MM-DD format

Format
date
end_date string

Filter cost history up to this date in YYYY-MM-DD format

Format
date
granularity string

The granularity of the cost data (e.g., daily, monthly)

Enum
  • daily
  • monthly
id string required

The unique identifier of the budget

Responses

Cost history retrieved successfully

Response body Headers
budget_id string

The unique identifier of the budget

cost_history array

This response does not contain any headers

Budget not found

Response body Headers

This response is empty

This response does not contain any headers

Response examples

Cost history retrieved successfully

{
  "budget_id": "budget_123",
  "cost_history": [
    {
      "date": "2023-06-01",
      "amount": 200.0
    },
    {
      "date": "2023-06-02",
      "amount": 180.0
    },
    {
      "date": "2023-06-03",
      "amount": 210.0
    }
  ]
}