v54

latestSwagger 2.0AGPL-3.0raw.githubusercontent.com2026-08-03397565628.8 KB
Chats

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

get/api/experimental/chats/{chat}/cost

Path parameters

chatstring uuid required

Chat ID

Response

OK

chat_idstring uuid
request_countinteger
total_cost_microsinteger
unpriced_request_countinteger