LLM API

Count tokens with a supported Algenta tokenizer model

Runs the selected tokenizer model and returns the deterministic token count.

post/v1/count_tokens

Request

  • Base URL: https://api.algenta.ai
  • URL: https://api.algenta.ai/v1/count_tokens
  • Auth: one of:
    • HTTP bearer
    • API key in header X-API-Key

Request body

modelstring

Model identifier from GET /v1/models.

inputstring required

UTF-8 text to count with the selected tokenizer.

Response

Successful Response

object'token_count'
modelstring required
tokenizer_kindstring required
token_countinteger required

Changes

No recorded changes to this operation across all 1 revision of this API.