---
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

---

[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)
