---
title: "GET /orgs/{org_id}/analytics/costs"
method: GET
path: "/orgs/{org_id}/analytics/costs"
tags: ["analytics"]
---

# GET /orgs/{org_id}/analytics/costs

`GET /orgs/{org_id}/analytics/costs`

Time-binned credits and USD spend across an org, grouped by product surface.

## Path parameters

- `org_id` string, required

## Query parameters

- `group_by` 'minute' | 'hour' | 'day'
- `from` integer, nullable
- `to` integer, nullable
- `user_id` string, nullable
- `project_id` string, nullable
- `resource_type` string, nullable

## Response `200`

Costs analytics

- OrgAnalyticsCostsBody
  - `bins` SourceBin[], required
    - `interval_ends_at` integer, required
    - `interval_starts_at` integer, required
    - `sources` SourceCosts[], required
      - `costs` SourceCost[], required
        - `credits` number, double, required
        - `id` integer, required
        - `name` string, required
        - `unit` string, required — Metered unit (`tokens`, `seconds`, ...) for surfaces with a dollar price; `credits` for credits-only surfaces.
        - `usd` number, double, nullable — Dollar spend. `null` for credits-only surfaces (`composer`, `kb_*`), which are priced in credits.
      - `credits` number, double, required
      - `resource_type` string, required — Product surface that produced the spend (`app_run`, `composer`, `kb_query`, `kb_file_parsing`, `kb_file_embedding`, `transcription`, `message`, `ace_run`, `org_api_request`, `project_api_request`), or `legacy` for rows recorded before source attribution existed.
      - `usd` number, double, nullable — Dollar spend. `null` for credits-only surfaces (`composer`, `kb_*`), which are priced in credits.
  - `from` integer, required
  - `group_by` 'minute' | 'hour' | 'day', required
  - `to` integer, required

## Other responses

- `400` — Bad request
- `403` — Forbidden
- `500` — Error

## Changes

- **2026-07-17** `33e77c7fd113` — 1 info
  - endpoint added
- **2026-03-16** `eb2c08128881` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/timbal-ai/apis/timbal-platform-api/changes/orgs/:org_id/analytics/costs/get.md)

---

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