Retrieves costs associated with all instances for the organization

GET /api/v2/billing/organizations/{organization_id}/costs/instances

Retrieves costs associated with all instances for the organization.

Path parameters

Query parameters

  • from string Required

    A datetime for the beginning of the desired range.

  • to string Required

    A datetime for the end of the desired range.

  • Specifies whether to include project names in the result by querying the control plane

Responses

  • 200 application/json

    Success. The costs associated to a set of instances.

    Hide response attributes Show response attributes object
    • instances array[object] Required

      Instance(id: 'str', name: 'str', total_ecu: 'int', type: 'str', product_line_items: 'list[ProductLineItem]')

      Hide instances attributes Show instances attributes object
      • id string Required
      • name string Required
      • product_line_items array[object] Required

        ProductLineItem(name: 'str', total_ecu: 'int', type: 'str', sku: 'str', unit: 'str', quantity: 'Quantity', display_quantity: 'DisplayQuantity', rate: 'Rate', kind: 'str | None', quantities: 'list[ProductLineItemQuantity]')

        Hide product_line_items attributes Show product_line_items attributes object
      • total_ecu integer Required
      • type string Required
    • total_ecu integer Required
  • The specified data range is invalid.

  • Current user does not have access to the requested organization.

  • Organization not found.

  • Internal server error.

GET /api/v2/billing/organizations/{organization_id}/costs/instances
curl \
 --request GET 'https://billing.elastic-cloud.com/api/v2/billing/organizations/{organization_id}/costs/instances?from=2021-04-21T00%3A00%3A00%2B00%3A00&to=2021-04-21T00%3A00%3A00%2B00%3A00'
Response examples (200)
{
  "instances": [
    {
      "id": "string",
      "name": "string",
      "product_line_items": [
        {
          "display_quantity": {
            "formatted_value": "string",
            "type": "default",
            "value": 42
          },
          "kind": "string",
          "name": "string",
          "quantities": [
            {
              "from": "2025-05-04T09:42:00Z",
              "quantity": {
                "formatted_value": "string",
                "value": 42
              },
              "rate": {
                "formatted_value": "string",
                "value": 42
              },
              "tiers": [
                {
                  "max": 42,
                  "min": 42,
                  "quantity": {
                    "formatted_value": "string",
                    "value": 42
                  },
                  "rate": {
                    "formatted_value": "string",
                    "value": 42
                  },
                  "total_ecu": 42
                }
              ],
              "to": "2025-05-04T09:42:00Z",
              "total_ecu": 42
            }
          ],
          "quantity": {
            "formatted_value": "string",
            "value": 42
          },
          "rate": {
            "formatted_value": "string",
            "value": 42
          },
          "sku": "string",
          "total_ecu": 42,
          "type": "string",
          "unit": "string"
        }
      ],
      "total_ecu": 42,
      "type": "string"
    }
  ],
  "total_ecu": 42
}