Skip to content

Get aggregated usage

GET
/api/v1/chat/usage
curl --request GET \
--url http://localhost:11044/api/v1/chat/usage \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

Returns aggregated LLM token usage, cost, and models used across the chat session and all child processes (action invocations, sidecars, cron, webhooks). This gives the true total cost of the session, not just the main chat process. A session with no process yet returns zeros.

Aggregated usage, or all zeros when the session has no process yet

Media type*/*
object

No active session

Media type*/*

A refusal from the chat surface: the word error and the reason, written to be shown

object
message
required

What was refused and why, such as no open stream, no active session, or an unknown command

string
status
required

Always error. A client may branch on it rather than on the status code

string

Example

error