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

# Tokenization

`POST /dedicated/v1/tokenize`

## Request

- Base URL: `https://api.friendli.ai`
- URL: `https://api.friendli.ai/dedicated/v1/tokenize`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/friendli/apis/friendli-suite-api-reference/docs/dedicated/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.

## Headers

- `X-Friendli-Team` string, nullable: ID of team to run requests as (optional parameter).

## Request body

- DedicatedTokenizationBody
  - `model` string, required: ID of target endpoint. If you want to send request to specific adapter, use the format "YOUR_ENDPOINT_ID:YOUR_ADAPTER_ROUTE". Otherwise, you can just use "YOUR_ENDPOINT_ID" alone.
  - `prompt` string, required: Input text prompt to tokenize.

## Response `200`

Successfully tokenized the text.

- DedicatedTokenizationSuccess
  - `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)
