Skip to main content
POST
/
api
/
v2
/
chat
/
document-analysis
/
token-count
cURL
curl --request POST \
  --url https://paradigm.lighton.ai/api/v2/chat/document-analysis/token-count \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>",
  "model": "<string>"
}
'
{
  "characters": 123,
  "tokens": 123,
  "max_model_len": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

Request serializer for count token.

text
string
required

The text to count tokens

model
string
required

Model to use for token count

Response

200 - application/json

Request serializer for count token.

characters
integer
required

Length of the text in characters

tokens
integer
required

Count of tokens for the text

max_model_len
integer
required

Max model tokens for the model