Langchain integration

Tokenize text (LangChain - Cohere format)

POST/langchain/cohere/v1/tokenize

Tokenizes text using Cohere-compatible format via LangChain.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:8080/langchain/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"
}