---
title: "Tokenize text with a supported Algenta tokenizer model"
method: POST
path: "/v1/tokenize"
tags: ["LLM API"]
---

# Tokenize text with a supported Algenta tokenizer model

`POST /v1/tokenize`

## Request

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

Runs the selected tokenizer model and returns the produced tokens. This initial LLM API tranche currently exposes deterministic word tokenization.

## Request body

- TokenizeRequest
  - `model` string: Model identifier from GET /v1/models.
  - `input` string, required: UTF-8 text to tokenize.

## Response `200`

Successful Response

- TokenizeResponse
  - `object` 'tokenization'
  - `model` string, required
  - `tokenizer_kind` string, required
  - `tokens` string[], required
  - `token_count` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/codna/apis/algenta-api.md) · [All operations](https://skmtc.dev/codna/apis/algenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codna/apis/algenta-api/revisions/35d30f84a5df?raw)
