Tokenize text (Cohere format)

Tokenizes text using Cohere v1 API format.

POST
/cohere/v1/tokenize
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

modelstring

Model whose tokenizer should be used

textstring

Text to tokenize (1-65536 characters)

Length1 <= length <= 65536

Response Body

curl -X POST "https://loading/{AI_GATEWAY_URL}/cohere/v1/tokenize" \  -H "Content-Type: application/json" \  -d '{    "model": "command-r-plus",    "text": "string"  }'
{
  "tokens": [
    0
  ],
  "token_strings": [
    "string"
  ],
  "meta": {
    "api_version": {
      "version": "string"
    }
  }
}
{
  "type": "string",
  "message": "string",
  "code": "string"
}
{
  "type": "string",
  "message": "string",
  "code": "string"
}
On this page

On this page

No Headings