What are the custom special tokens in tiktoken/token libraries? Use cases?

The library shows its general-purpose origins.

Custom special tokens are not useful with OpenAI products, as you can’t add new string to token mappings in the endpoints, and in fact existing ones are not encoded for you, except for “<|endoftext|>” on completions, and those used as stop tokens when emitted by chat AI.

If you had your own AI model, you could use special token numbers (that the user can’t pass or simulate) to do things like train the AI to emit functions enclosed in special tokens that can be recognized by the endpoint, or enclose knowledge retrieval in a specially-recognized container.

model/token string: input tokens/output tokens
babbage-002/<|endoftext|>: 1/1
babbage-002/<|im_start|>: 6/1
babbage-002/<|im_end|>: 6/1

And yes, OpenAI is completely capable of putting chat models on a completion endpoint and encoding the tokens.