Skip to main content

Interface: TokenRecordOptions

Options accepted by recordUsage when logging token consumption.

Properties​

kind?​

optional kind: string;

Optional usage classification.


metadata?​

optional metadata: Record<string, unknown>;

Additional metadata, such as guild or user identifiers.


model​

model: string;

Model identifier being charged.


timestamp?​

optional timestamp: number;

Override timestamp for backfilled events.


tokensIn?​

optional tokensIn: number;

Prompt tokens to record.


tokensOut?​

optional tokensOut: number;

Completion tokens to record.