Tokenization
Inference
Model APIs Tokenization
Tokenize text into token IDs using Friendli Model APIs. Useful for counting tokens before sending inference requests to the model.
POST
Tokenization
By giving a text input, generate a tokenized output of token IDs.
To request successfully, it is mandatory to enter a Personal API Key (e.g. flp_XXX) value in the Bearer Token field.
Refer to the authentication section on our introduction page to learn how to acquire this variable and visit here to generate your API Key.
Authorizations
Headers
ID of team to run requests as (optional parameter).
Body
application/json
Code of the model to use. See available model list.
Example:
"zai-org/GLM-5.2"
Input text prompt to tokenize.
Example:
"What is generative AI?"
Response
Successfully tokenized the text.
A list of token IDs.
Last modified on June 9, 2026