Skip to main content
Convert an array of token IDs back into readable text. This is the inverse operation of openai_tokenize() and is useful for debugging tokenization or reconstructing text from tokens.

Samples

Detokenize tokens

Convert token IDs back into text:
Returns:

Round-trip tokenization

Verify tokenization is reversible:
Returns:

Arguments

Returns

TEXT: The reconstructed text from the token IDs.