Chats
Get chat cost
Changed onCost 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/v2/chats/{chat}/cost
Request
- Base URL/ (relative, and the document was published on a file host, not at the API’s origin)
- URL/api/v2/chats/{chat}/cost
- AuthAPI key in header Coder-Session-Token
Path parameters
chatstring uuid required
Chat ID
Response
OK
Changes
- info
endpoint added
- info