/v1/detokenizeDetokenizeThis endpoint takes tokens using byte-pair encoding and returns their text representation. To learn more about tokenization and byte pair encoding, see the tokens page.
Parameters
X-Client-NamestringheaderThe name of the project that is making the request.
Request body
application/json
modelstringrequiredAn optional parameter to provide the model name. This will ensure that the detokenization is done by the tokenizer used by that model.
tokensarray of integerrequiredThe list of tokens to be detokenized.
Show child attributes
{
"model": "string",
"tokens": [
0
]
}Responses
Headers
X-API-WarningThe name of the project that is making the request.
metaobjectShow child attributes
api_versionobjectShow child attributes
is_deprecatedbooleanis_experimentalbooleanversionstringrequiredbilled_unitsobjectShow child attributes
classificationsnumberThe number of billed classifications units.
image_tokensnumberThe number of billed image tokens.
imagesnumberThe number of billed images.
input_tokensnumberThe number of billed input tokens.
output_tokensnumberThe number of billed output tokens.
pagesnumberThe number of billed pages parsed.
search_unitsnumberThe number of billed search units.
cached_tokensnumberThe number of prompt tokens that hit the inference cache.
tokensobjectShow child attributes
input_tokensnumberThe number of tokens used as input to the model.
output_tokensnumberThe number of tokens produced by the model.
warningsarray of stringShow child attributes
textstringrequiredA string representing the list of tokens.
{
"meta": {
"api_version": {
"is_deprecated": true,
"is_experimental": true,
"version": "string"
},
"billed_units": {
"classifications": 0,
"image_tokens": 0,
"images": 0,
"input_tokens": 0,
"output_tokens": 0,
"pages": 0,
"search_units": 0
},
"cached_tokens": 0,
"tokens": {
"input_tokens": 0,
"output_tokens": 0
},
"warnings": [
"string"
]
},
"text": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}