Skip to main content

Interface: TokenLimitRule

Configuration describing a single token limit rule.

Properties

maxTokens

maxTokens: number;

Maximum tokens allowed within the window.


message?

optional message: string;

Optional message surfaced when the limit is exceeded.


mode?

optional mode: TokenLimitMode;

Enforcement mode. Use block to throw TokenLimitError, or warn to emit events without blocking execution.


window

window: TokenSummaryWindow;

Sliding window in which the limit is evaluated.