---
type: api
title: Get instances costs for the organization.
description: Retrieves costs associated with all instances for the organization.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-billing/operation/operation-getcostsbyinstancesv2
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-billing/operation/operation-getcostsbyinstancesv2
products:
  - Elastic Cloud Hosted
---

# Get instances costs for the organization.

- Server: `https://cloud.elastic.co` (Public)

## Paths

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

#### Path Parameters

- `organization_id` (string)
  Identifier for the organization

## Description

Retrieves costs associated with all instances for the organization.
Admin callers receive all instances; non-admin user callers receive
data filtered to the instances they have access to (empty result if
none).

## Query String Parameters

- `from` (string)
  A datetime for the beginning of the desired range. Any timezone offset is accepted and converted to UTC internally. Responses always contain UTC values. If no timezone offset is specified, UTC is assumed.
- `to` (string)
  A datetime for the end of the desired range. Any timezone offset is accepted and converted to UTC internally. Responses always contain UTC values. If no timezone offset is specified, UTC is assumed.
- `include_names` (boolean)
  Specifies whether to include project names in the result by querying the control plane

## Responses

#### `200`

Success. The costs associated to a set of instances.

`application/json`

- `instances` ([] Instance)
  - `id` (string)
  - `name` (string)
  - `product_line_items` ([] ProductLineItem)
    - `display_quantity` ({} DisplayQuantity)
      Display quantity
      - `formatted_value` (string)
      - `type` (enum)
        Values: `default`, `normalized`
      - `value` (integer | number)
    - `kind` (string)
    - `name` (string)
    - `quantities` ([] ProductLineItemQuantity)
      - `from` (string)
      - `quantity` ({} Quantity)
        Quantity
        - `formatted_value` (string)
        - `value` (integer | number)
      - `rate` ({} Rate)
        Rate(value: 'int', formatted_value: 'str')
        - `formatted_value` (string)
        - `value` (integer)
      - `tiers` ([] ProductLineItemTier)
        - `max` (integer)
        - `min` (integer)
        - `quantity` ({} Quantity)
          Quantity
          - `formatted_value` (string)
          - `value` (integer | number)
        - `rate` ({} Rate)
          Rate(value: 'int', formatted_value: 'str')
          - `formatted_value` (string)
          - `value` (integer)
        - `total_ecu` (integer)
      - `to` (string)
      - `total_ecu` (integer)
    - `quantity` ({} Quantity)
      Quantity
      - `formatted_value` (string)
      - `value` (integer | number)
    - `rate` ({} Rate)
      Rate(value: 'int', formatted_value: 'str')
      - `formatted_value` (string)
      - `value` (integer)
    - `sku` (string)
    - `total_ecu` (integer)
    - `type` (string)
    - `unit` (string)
  - `total_ecu` (integer)
  - `type` (string)
- `total_ecu` (integer)
#### `400`

The specified data range is invalid.

#### `403`

Current user does not have access to the requested organization.

#### `404`

Organization not found.

#### `500`

Internal server error.

## Code Examples

#### Console

```console
GET /api/v2/billing/organizations/{organization_id}/costs/instances?from={from}&to={to}
```

#### curl

```curl
curl -X GET "https://cloud.elastic.co/api/v2/billing/organizations/{organization_id}/costs/instances?from={from}&to={to}"
```

