Resource usage statistics.
Used to track and budget LLM tokens, cost, and execution time.
const usage: Usage = { tokens: 1500, cost: 0.0023, duration: 5432}; Copy
const usage: Usage = { tokens: 1500, cost: 0.0023, duration: 5432};
Total number of tokens used (input + output).
Total cost in USD.
Total duration in milliseconds.
Resource usage statistics.
Used to track and budget LLM tokens, cost, and execution time.
Example