Serverless.Token

Tokenization

By giving a text input, generate a tokenized output of token IDs.

post/serverless/v1/tokenize

Request

Headers

X-Friendli-Teamstring nullable

ID of team to run requests as (optional parameter).

Request body

modelstring required

Code of the model to use. See available model list.

promptstring required

Input text prompt to tokenize.

Example request

{
  "model": "meta-llama/Llama-3.1-8B-Instruct",
  "prompt": "What is generative AI?"
}

Response

Successfully tokenized the text.

tokensinteger[] required

A list of token IDs.

Changes

No recorded changes to this operation across all 1 revision of this API.