Text tools

Count tokens

Exact token counts with OpenAI tokenizers, by encoding or model name. Other vendors do not publish their tokenizers, so their counts are not offered.

get/v1/text/tokens

Request

  • Base URL: https://api.dharun.dev
  • URL: https://api.dharun.dev/v1/text/tokens
  • Auth: none declared

Query parameters

textstring

The text (or POST it).

modelstring

Model name, such as gpt-4o or gpt-4, or an encoding: o200k_base, cl100k_base, p50k_base. Default o200k_base.

Response

Success

dataunknown required

Changes

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