gpt-tokenizer breaking changes
gpt-tokenizer 4.0.2 (October 15, 2026) is its newest release with breaking changes. The first: Encoding and splitting of U+0085 and U+FEFF now match tiktoken in gpt-tokenizer 4.0.2. Every breaking API change we have recorded in gpt-tokenizer on npm: 17 breaking changes in 3 versions. Below, its 3 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 4.1.2, released November 10, 2026. Source repository
Packages on npm run on Node.js. Node.js end of life dates.
gpt-tokenizer 4.0.2 breaking changes
- Behavior changed
Text containing U+0085 or U+FEFF is now split and encoded the same way tiktoken does, so token output for those characters may differ from earlier versions. github.com
gpt-tokenizer 4.0.0 breaking changes
- Removed
Browser users loading the package from unpkg as a global script or UMD bundle must switch to ES module imports. github.com - Behavior changed
Browser code that relied on the old non-module builds must now load the package as an ES module. github.com - Signature changed
cjs:encodeChat
Was const encodeChat: (chat: readonly import("../functionCalling.js").ChatMessage[], model?: "chatgpt-4o-latest" | "codex-mini-latest" | "computer-use-preview" | "computer-use-preview-2025-03-11" | "gpt-3.5" | "gpt-3.5-0301" |... npmjs.com - Signature changed
cjs:encodeChatGenerator
Was const encodeChatGenerator: (chat: Iterable<import("../functionCalling.js").ChatMessage>, model?: "chatgpt-4o-latest" | "codex-mini-latest" | "computer-use-preview" | "computer-use-preview-2025-03-11" | "gpt-3.5" | "gpt-3.5-0301" |... npmjs.com - Signature changed
countTokens
Was const countTokens: (input: string | Iterable<import("../functionCalling.js").ChatMessage>, encodeOptions?: import("../GptEncoding.js").EncodeOptions) => number; now const countTokens: (input: string | Iterable<ChatMessage>... npmjs.com - Signature changed
encode
Was const encode: (lineToEncode: string, encodeOptions?: import("../GptEncoding.js").EncodeOptions) => number[]; now const encode: (lineToEncode: string, encodeOptions?: EncodeOptions) => number[]. npmjs.com - Signature changed
encodeChat
Was const encodeChat: (chat: readonly import("../functionCalling.js").ChatMessage[], model?: "chatgpt-4o-latest" | "codex-mini-latest" | "computer-use-preview" | "computer-use-preview-2025-03-11" | "gpt-3.5" | "gpt-3.5-0301" |... npmjs.com - Signature changed
encodeChatGenerator
Was const encodeChatGenerator: (chat: Iterable<import("../functionCalling.js").ChatMessage>, model?: "chatgpt-4o-latest" | "codex-mini-latest" | "computer-use-preview" | "computer-use-preview-2025-03-11" | "gpt-3.5" | "gpt-3.5-0301" |... npmjs.com - Signature changed
encodeGenerator
Was const encodeGenerator: (lineToEncode: string, encodeOptions?: import("../GptEncoding.js").EncodeOptions) => Generator<number[], number, undefined>; now const encodeGenerator: (lineToEncode: string, encodeOptions?: EncodeOptions) =>... npmjs.com - Signature changed
estimateCost
Was const estimateCost: (tokenCount: number, modelSpec?: import("../modelTypes.js").ModelSpec | undefined) => import("../modelTypes.js").PriceData; now const estimateCost: (tokenCount: number, modelSpec?: ModelSpec | undefined) =>... npmjs.com
And 1 more in this version. Sign up to see every change
gpt-tokenizer 3.0.0 breaking changes
- Default changed
The default encoding is now o200k_base, which most modern models use. Code relying on the previous default must now pass the encoding explicitly to keep its old token counts. github.com - Default changed
The default encoding is now o200k_base, which most modern models use. Code relying on the previous default must now pass the encoding explicitly to keep its old token counts. github.com - Signature changed
encodeChat
Was const encodeChat: (chat: readonly import("../GptEncoding.js").ChatMessage[], model?: "gpt-4o" | "gpt-3.5-turbo" | "gpt-3.5-turbo-instruct" | "babbage-002" | "davinci-002" | "text-embedding-3-small" | "o1" | "o1-2024-12-17" |... npmjs.com - Signature changed
encodeChatGenerator
Was const encodeChatGenerator: (chat: Iterable<import("../GptEncoding.js").ChatMessage>, model?: "gpt-4o" | "gpt-3.5-turbo" | "gpt-3.5-turbo-instruct" | "babbage-002" | "davinci-002" | "text-embedding-3-small" | "o1" | "o1-2024-12-17" |... npmjs.com - Signature changed
estimateCost
Was const estimateCost: (tokenCount: number, modelName?: "gpt-4o" | "gpt-3.5-turbo" | "gpt-3.5-turbo-instruct" | "babbage-002" | "davinci-002" | "text-embedding-3-small" | "o1" | "o1-2024-12-17" | "o1-preview" | "o1-preview-2024-09-12" |... npmjs.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.