cs log-ai is how you manually tell CostHQ about an AI API call. You need this command whenever you are running a manual session or a custom agent workflow that is not already routing traffic through the CostHQ proxy. Each invocation creates one AI usage record attached to the active session (or to the session you specify with -s).
Usage
Flags
Examples
JSON Output
cs log-ai --json returns the logged usage entry plus a pricing object so you can verify how the cost was calculated:
pricing.source values
When
modelKnown is false, CostHQ cannot calculate cost automatically — you must supply -c <amount> or the entry will be recorded with cost: 0. Use cs pricing set to add a permanent custom price for that model so future calls calculate automatically.