---
title: "Query feature cost"
method: POST
path: "/v3/openmeter/features/{featureId}/cost/query"
tags: ["OpenMeter Features"]
---

# Query feature cost

`POST /v3/openmeter/features/{featureId}/cost/query`

**Pre-release Endpoint**
This endpoint is currently in beta and is subject to change.

Query the cost of a feature.

## Path parameters

- `featureId` string, required — ULID (Universally Unique Lexicographically Sortable Identifier).

## Request body

- MeterQueryRequest — A meter query request.
  - `from` string, date-time — The start of the period the usage is queried from.
  - `to` string, date-time — The end of the period the usage is queried to.
  - `granularity` 'PT1M' | 'PT1H' | 'P1D' | 'P1M' — The size of the time buckets to group the usage into. If not specified, the usage is aggregated over the entire period.
  - `time_zone` string — The value is the name of the time zone as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). The time zone is used to determine the start and end of the time buckets. If not specified, the UTC timezone will be used.
  - `group_by_dimensions` string[] — The dimensions to group the results by.
  - `filters` object — Filters to apply to the query.
    - `dimensions` object — Filters to apply to the dimensions of the query. For `subject` and `customer_id` only equals ("eq", "in") comparisons are supported.

## Response `200`

The request has succeeded.

- FeatureCostQueryResult — Result of a feature cost query.
  - `from` string, date-time — Start of the queried period.
  - `to` string, date-time — End of the queried period.
  - `data` FeatureCostQueryRow[], required — The cost data rows.
    - `usage` string, required — The metered usage value for the period.
    - `cost` string, nullable, required — The computed cost amount (usage × unit cost). Null when pricing is not available for the given combination of dimensions.
    - `currency` string, required — The currency code of the cost amount.
    - `detail` string — Detail message when cost amount is null, explaining why the cost could not be resolved.
    - `from` string, date-time, required — The start of the time bucket the value is aggregated over.
    - `to` string, date-time, required — The end of the time bucket the value is aggregated over.
    - `dimensions` object, required — The dimensions the value is aggregated over. `subject` and `customer_id` are reserved dimensions.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/kong/apis/konnect-api-go-sdk.md) · [All operations](https://skmtc.net/kong/apis/konnect-api-go-sdk/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/konnect-api-go-sdk/versions/0261aef4b1e2/schema)
