---
title: "What this conversation has cost so far."
method: GET
path: "/ai/conversations/{public_id}/usage"
tags: ["AI Chat"]
---

# What this conversation has cost so far.

`GET /ai/conversations/{public_id}/usage`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/conversations/{public_id}/usage`
- Auth: HTTP bearer

Read from the AI gateway's usage log for the conversation's owner only.
Figures are estimates: requests to a model with no known price are counted
in `unpriced_requests` instead of being silently priced at zero.

## Path parameters

- `public_id` string, required

## Response `200`

- ConversationUsage: What one conversation has cost so far.
  - `byok_requests` integer, required: Requests made with the user's own provider key rather than the platform's, which Temps does not bill.
  - `context` ConversationContext: How much of the model's context the chat fills right now: the prompt size of its latest request, which is the whole conversation, the system framing and the tool definitions as the model last saw them.
    - `model` string, required: Model of that request.
    - `tokens` integer, required: Prompt tokens of the latest request, as the provider counted them.
    - `window` integer, nullable: The model's context window in tokens, when its catalogue lists one.
  - `cost_microcents` integer, required: Estimated cost in microcents (1/10000 of a cent), summed over the requests that have a known price.
  - `input_tokens` integer, required
  - `models` ModelSpend[], required
    - `cost_microcents` integer, required: Estimated cost in microcents (1/10000 of a cent), as logged.
    - `input_tokens` integer, required
    - `model` string, required
    - `output_tokens` integer, required
    - `requests` integer, required
  - `output_tokens` integer, required
  - `requests` integer, required
  - `summarized_messages` integer, required: Earlier messages folded into the chat's running summary, so the model no longer sees them word for word. `0` when the chat was never compacted or the count could not be read.
  - `unpriced_requests` integer, required: Requests that used tokens but were logged at zero cost because the model has no known price. When this is not zero, the cost is a floor.

## Other responses

- `401`
- `403`
- `404`

## Changes

> 81 revisions in range; 1 not diffed.

- **2026-10-20** `79089e9f49ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/conversations/:public_id/usage/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) · [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) · [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/ab6d5d19e930?raw)
