SDK Reference
Tokenizer
Use the Tokenizer to calculate the number of tokens in a given piece of text.
The Tokenizer is a free
and a useful tool provided by the iQ Suite Platform that allows you to calculate the number of tokens in a given piece of text. This is particularly useful for estimating token expenditure when interacting with language models, as many models charge based on token usage.
Rate Limiting
The Tokenizer method is rate-limited to 50 requests per minute to ensure fair usage and maintain system performance. Exceeding this limit will result in throttled requests.
HTTP Request
POST /tokenizer
Authentication
All requests must include an Authorization
header with a valid API key.
Headers
Key | Value |
---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | application/json |
Request Body
- text: The input text for which you want to calculate the token count.
JSON
Field | Type | Description |
---|---|---|
text | string | The text to tokenize |
Request Example
Response
Success
Status Code: 200 OK
Body:
Fields
Field | Type | Description |
---|---|---|
tokens_count | number | The number of tokens in the input text |