---
title: "query for costs and resources allocated to Kubernetes workloads"
method: GET
path: "/allocation"
---

# query for costs and resources allocated to Kubernetes workloads

`GET /allocation`

The standard OpenCost API query for costs and resources allocated to Kubernetes workloads.  Note that 'data' is an array of sets (one per 'step').

## Query parameters

- `window` string, required
- `aggregate` string
- `step` string
- `accumulate` boolean

## Response `200`

Success

- AllocationResponse
  - `code` integer
  - `status` string
  - `data` object[]

## Other responses

- `400` — Bad request — missing or invalid parameters (e.g. `window`, `step`, `accumulateBy`)
- `500` — Internal server error — the allocation query failed

## Changes

- **2026-07-16** `c440ab5efe8e` — 2 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `500`
- **2026-02-05** `0ce7443accd4` — 4 warning, 1 info
  - deleted the `query` request parameter `resolution`
  - removed the optional property `data/items/kube-system` from the response with the `200` status
  - removed the optional property `data/items/opencost` from the response with the `200` status
  - removed the optional property `data/items/prometheus` from the response with the `200` status
  - …1 more
- **2024-10-26** `9fa09c2602f4` — 1 info
  - endpoint added
- **2023-01-20** `3cbff640f287` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/opencost/apis/opencost-api/changes/allocation/get.md)

---

[API](https://skmtc.dev/opencost/apis/opencost-api.md) · [All operations](https://skmtc.dev/opencost/apis/opencost-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/opencost/opencost-api/revisions/c4d279a26333/schema)
