/v1/tokenizeTokenizeThis endpoint splits input text into smaller units called tokens using byte-pair encoding (BPE). 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
modelstringrequiredThe input will be tokenized by the tokenizer that is used by this model.
textstringrequiredThe string to be tokenized, the minimum text length is 1 character, and the maximum text length is 65536 characters.
{
"model": "command",
"text": "tokenize me! :D"
}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
token_stringsarray of stringrequiredShow child attributes
tokensarray of integerrequiredAn array of tokens, where each token is an integer.
Show child attributes
{
"meta": {
"api_version": {
"version": "1"
}
},
"token_strings": [
"token",
"ize'",
" me",
"!",
" :",
"D"
],
"tokens": [
34160,
974,
514,
34,
1420,
69
]
}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"
}