Skip to main content

TokenCounter

@forge/monorepo


@forge/monorepo / backend/src / TokenCounter

Interface: TokenCounter

Defined in: backend/src/usage/index.ts:124

Provider-aware token estimate used for budgeting and pre-flight ceiling checks (doc 03/12). Actuals from the provider response are authoritative and reconcile these estimates afterwards.

Methods

estimate()

estimate(text): number

Defined in: backend/src/usage/index.ts:125

Parameters

text

string

Returns

number