Skip to main content
Convert text into an array of token IDs using Cohere’s tokenizer. Useful for counting tokens before API calls or analyzing tokenization patterns.

Samples

Tokenize text

Returns: {5432, 8754, 389, 264, 8147, 4729}

Count tokens

Arguments

Returns

INT[]: Array of token IDs.