---
title: "Get chat cost"
method: GET
path: "/api/experimental/chats/{chat}/cost"
tags: ["Chats"]
---

# Get chat cost

`GET /api/experimental/chats/{chat}/cost`

Experimental: this endpoint is subject to change.

Cost covers the whole chat tree: the root chat plus every
subagent chat beneath it. Requesting cost for a subagent chat
returns that same total.

Cost is derived from AI Gateway data, which is subject to its
own retention period, 60 days by default, configured
independently of chat retention. Spend for requests older than
that period is no longer reported, so a chat whose requests
have all been purged reports zero cost.

## Path parameters

- `chat` string, uuid, required

## Response `200`

OK

- CodersdkChatCost
  - `chat_id` string, uuid
  - `request_count` integer
  - `total_cost_micros` integer
  - `unpriced_request_count` integer

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
