How to count tokens with tiktoken
4. Turn tokens into text with encoding.decode()
.decode() converts a list of token integers to a string.

encoding.decode([83, 1609, 5963, 374, 2294, 0])

'tiktoken is great!'
Warning: although .decode() can be applied to single tokens, beware that it can be lossy for tokens that aren't on utf-8 boundaries.

For single tokens, .decode_single_token_bytes() safely converts a single integer token to the bytes it represents.