# Function createTokenCounter

Context exports - Context management and token counting Split from index.ts for file size compliance (Issue #285)

- createTokenCounter(config?: TokenCounterConfig): TokenCounter

  Creates a TokenCounter instance with the specified configuration.

  #### Parameters

  - config: TokenCounterConfig = {}

    Token counter configuration

  #### Returns TokenCounter

  Configured TokenCounter instance

  #### Example

      const counter = createTokenCounter({
        anthropicApiKey: process.env.ANTHROPIC_API_KEY,
        googleApiKey: process.env.GOOGLE_AI_API_KEY,
      });

  - Defined in packages/nexus-agents/src/context/token-counter.ts:392