v1

latestOpenAPI 3.1.02026-07-263971,2281.1 MB
ChatService

GetLlmUsage

post/textql.rpc.public.chat.ChatService/GetLlmUsage

Headers

Connect-Protocol-Version1 required

Define the version of the Connect protocol

Connect-Timeout-Msnumber

Define the timeout, in ms

Request body

chatIdstring
includeCostsboolean

Response

Success

contextWindowUsednumber double

range: [0, 1]

estimatedCostnumber double nullable

Estimated LLM-token cost (USD, list model prices). LLM only.

estimatedComputeCostnumber double nullable

Estimated sandbox/compute cost for this chat (USD): chat sandbox-seconds → ACUs → USD at the org's effective rate. Add to estimated_cost for the thread's total cost. Requires the console rate (0/omitted if unavailable).

sandboxIdstring nullable

The chat's sandbox id ({orgID}-{chatID}), set when the thread used any sandbox compute. Lets the UI deep-link to the sandbox detail. Empty/omitted when the thread had no sandbox usage.

estimatedComputeAcusnumber double nullable

Sandbox compute usage for this chat in ACUs (sandbox-seconds / 3600 × ACUs per instance-hour). The metered unit behind estimated_compute_cost; shown alongside the dollars. Independent of the console $ rate, so present whenever the thread used a sandbox.

Example response

{
  "usage": [
    {
      "timestamp": "2023-01-15T01:30:15.01Z"
    }
  ]
}