Skip to main content
POST
/
langchain
/
cohere
/
v1
/
tokenize
Error
A valid request URL is required to generate request examples
{
  "tokens": [
    123
  ],
  "token_strings": [
    "<string>"
  ],
  "meta": {
    "api_version": {
      "version": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your provider API key or Bifrost authentication token. Virtual keys (prefixed with sk-bf-) can also be passed here.

Body

application/json
model
string
required

Model whose tokenizer should be used

Example:

"command-r-plus"

text
string
required

Text to tokenize (1-65536 characters)

Required string length: 1 - 65536

Response

Successful response

tokens
integer[]

Token IDs

token_strings
string[]

Token strings

meta
object

Metadata returned by the tokenize endpoint