Tokenize

POST

Generates tokens for a string using a model’s tokenizer.

Request

This endpoint expects an object.
modelstringRequired

The name of the model to use for tokenization.

inputstringRequired

The text to tokenize.

Response

Successful response.

idstringOptional

Unique ID for the token.

objectstringOptional

Type of object (tokens).

createdintegerOptional

Timestamp of when the tokens were generated.

modelstringOptional

The name of the model used.

tokenslist of objectsOptional

An array of token data.

Errors