v36

OpenAPI 3.1.0raw.githubusercontent.com2026-08-0187270483.0 KB
Collections

Count tokens for texts

Count the number of tokens in the provided texts using the BGE M3 tokenizer. This is useful for checking if texts will fit within the embedding model's token limit (8,192 tokens per text) before sending them for embedding.

post/v3/collections/token-count

Request body

textsstring[] required

One or more texts to tokenize.

Response

The request has succeeded.

total_tokensinteger

Sum of token_count across all texts.

max_token_limitinteger

Maximum tokens allowed per text by the embedding model.

texts_exceeding_limitinteger

Number of input texts that exceed max_token_limit.