---
title: "Tokenization"
method: POST
path: "/v1/tokenize"
tags: ["Container.Token"]
---

# Tokenization

`POST /v1/tokenize`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/v1/tokenize`
- Auth: none declared
- TypeScript: <https://skmtc.dev/friendli/apis/friendli-suite-api-reference/docs/v1/tokenize/post.ts> (a function with typed inputs; its response is checked against the schema)

By giving a text input, generate a tokenized output of token IDs.

## Request body

- ContainerTokenizationBody
  - `model` string, nullable: Routes the request to a specific adapter.
  - `prompt` string, required: Input text prompt to tokenize.

## Response `200`

Successfully tokenized the text.

- ContainerTokenizationSuccess
  - `tokens` integer[], required: A list of token IDs.

## Other responses

- `422`: Unprocessable Entity

---

[API](https://skmtc.dev/friendli/apis/friendli-suite-api-reference.md) - [All operations](https://skmtc.dev/friendli/apis/friendli-suite-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/friendli/apis/friendli-suite-api-reference/revisions/38fb43993a11?raw)
